aboutsummaryrefslogtreecommitdiffstats
path: root/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-21 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-21 20:20:20 +0100
commit64591d70cf020fbcd85cfc45d6034c0a0bc8de20 (patch)
treeb2a28e61ea43fea76d2397472d9897eb98e56a88 /i_events.go
parentclean list delete (diff)
downloadhardflip-64591d70cf020fbcd85cfc45d6034c0a0bc8de20.tar.gz
hardflip-64591d70cf020fbcd85cfc45d6034c0a0bc8de20.tar.bz2
hardflip-64591d70cf020fbcd85cfc45d6034c0a0bc8de20.tar.xz
hardflip-64591d70cf020fbcd85cfc45d6034c0a0bc8de20.tar.zst
hardflip-64591d70cf020fbcd85cfc45d6034c0a0bc8de20.zip
cool delete
Diffstat (limited to 'i_events.go')
-rw-r--r--i_events.go10
1 files changed, 5 insertions, 5 deletions
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