From 64591d70cf020fbcd85cfc45d6034c0a0bc8de20 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 21 Dec 2023 20:20:20 +0100 Subject: cool delete --- i_events.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'i_events.go') diff --git a/i_events.go b/i_events.go index 5177434..5539e59 100644 --- a/i_events.go +++ b/i_events.go @@ -64,18 +64,18 @@ func i_reload_data(data *HardData) { func i_delete_host(data *HardData) { ui := &data.ui + host := data.lhost.sel(data.ui.sel) + file_path := data.data_dir + "/" + host.Folder + host.Filename + if err := os.Remove(file_path); err != nil { + c_die("can't remove " + file_path, err) + } data.lhost.del(data.ui.sel) data.lhost.reset_id() ui.sel_max = data.lhost.count() if ui.sel >= ui.sel_max { ui.sel = ui.sel_max - 1 } - // file_path := data.data_dir + "/" + host.Folder + host.Filename - // if err := os.Remove(file_path); err != nil { - // c_die("can't remove " + file_path, err) - // } - // i_reload_data(data) } // screen events such as keypresses -- cgit v1.2.3