diff options
author | Joe <rbo@gmx.us> | 2024-04-25 20:20:20 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-25 20:20:20 +0200 |
commit | d5096d447b67cb30cbf242fe708a4b911d57344f (patch) | |
tree | a3cedc0f780e53f942004ee112b7194a2a62f1f1 /src/i_insert.go | |
parent | ok (diff) | |
download | hardflip-d5096d447b67cb30cbf242fe708a4b911d57344f.tar.gz hardflip-d5096d447b67cb30cbf242fe708a4b911d57344f.tar.bz2 hardflip-d5096d447b67cb30cbf242fe708a4b911d57344f.tar.xz hardflip-d5096d447b67cb30cbf242fe708a4b911d57344f.tar.zst hardflip-d5096d447b67cb30cbf242fe708a4b911d57344f.zip |
qwe
Diffstat (limited to 'src/i_insert.go')
-rw-r--r-- | src/i_insert.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/i_insert.go b/src/i_insert.go index 0bb55a8..58fba1e 100644 --- a/src/i_insert.go +++ b/src/i_insert.go @@ -139,13 +139,11 @@ func i_insert_host(data *HardData, insert *HostNode) { insert.Drive = nil } filename := insert.filename - replace := false - if len(filename) == 0 || data.yank != nil { + if data.ui.insert_method == INSERT_ADD || + data.ui.insert_method == INSERT_COPY { filename = i_insert_format_filename(insert.Name, data.data_dir + insert.parent.path()) insert.filename = filename - } else { - replace = true } fmt, err := yaml.Marshal(insert) if err != nil { @@ -160,7 +158,7 @@ func i_insert_host(data *HardData, insert *HostNode) { data.insert = nil return } - if replace == true && data.litems.curr != nil { + if data.ui.insert_method == INSERT_EDIT && data.litems.curr != nil { tmp := e_deep_copy_host(data.insert) data.litems.curr.Host = &tmp data.litems.reset_id() |