From d5096d447b67cb30cbf242fe708a4b911d57344f Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 25 Apr 2024 20:20:20 +0200 Subject: qwe --- src/i_insert.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/i_insert.go') 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() -- cgit v1.2.3