aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-05-21 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-05-21 20:20:20 +0200
commitf9a187d8e6cac698b6778f5e7db5901f7738ff92 (patch)
tree115efda7ccfdd51b674be068d9da9d0bb6db9322
parentversion update (diff)
downloadhardflip-f9a187d8e6cac698b6778f5e7db5901f7738ff92.tar.gz
hardflip-f9a187d8e6cac698b6778f5e7db5901f7738ff92.tar.bz2
hardflip-f9a187d8e6cac698b6778f5e7db5901f7738ff92.tar.xz
hardflip-f9a187d8e6cac698b6778f5e7db5901f7738ff92.tar.zst
hardflip-f9a187d8e6cac698b6778f5e7db5901f7738ff92.zip
on the way
-rw-r--r--src/e_keys.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/e_keys.go b/src/e_keys.go
index 620a413..f871038 100644
--- a/src/e_keys.go
+++ b/src/e_keys.go
@@ -176,6 +176,15 @@ func e_normal_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
ui.insert_sel = 0
ui.insert_sel_ok = false
ui.insert_scroll = 0
+ tmp := ItemsNode{}
+ tmp_host := HostNode{}
+ tmp.Host = &tmp_host
+ if data.litems.curr.is_dir() == true {
+ tmp_host.parent = data.litems.curr.Dirs
+ } else {
+ tmp_host.parent = data.litems.curr.Host.parent
+ }
+ data.litems.add_after(&tmp)
} else if event.Rune() == 'e' &&
data.litems.curr != nil &&
data.litems.curr.is_dir() == false {
@@ -353,6 +362,12 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
ui.insert_sel = 0
data.insert = nil
ui.buff.empty()
+ tmp := data.litems.curr.prev
+ data.litems.del(data.litems.curr)
+ if tmp == nil {
+ tmp = data.litems.head
+ }
+ data.litems.curr = tmp
} else if event.Key() == tcell.KeyEnter {
if ui.buff.len() == 0 {
ui.s.HideCursor()
@@ -361,6 +376,12 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
ui.insert_sel_ok = false
data.insert = nil
ui.buff.empty()
+ tmp := data.litems.curr.prev
+ data.litems.del(data.litems.curr)
+ if tmp == nil {
+ tmp = data.litems.head
+ }
+ data.litems.curr = tmp
return true
}
ui.s.HideCursor()
@@ -375,6 +396,7 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
}
} else {
e_readline(event, &ui.buff, ui, data.home_dir)
+ data.litems.curr.Host.Name = ui.buff.str()
}
} else if data.insert != nil {
if data.insert_err != nil {