aboutsummaryrefslogtreecommitdiffstats
path: root/src/e_keys.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-05-09 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-05-09 20:20:20 +0200
commit79c7469a9e8efff160335aa6e9b3046197e883e4 (patch)
tree2426234ab83c6a2be0fe145986c96b497b84c038 /src/e_keys.go
parenttmp (diff)
downloadhardflip-79c7469a9e8efff160335aa6e9b3046197e883e4.tar.gz
hardflip-79c7469a9e8efff160335aa6e9b3046197e883e4.tar.bz2
hardflip-79c7469a9e8efff160335aa6e9b3046197e883e4.tar.xz
hardflip-79c7469a9e8efff160335aa6e9b3046197e883e4.tar.zst
hardflip-79c7469a9e8efff160335aa6e9b3046197e883e4.zip
not quite but gettin close
Diffstat (limited to '')
-rw-r--r--src/e_keys.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/e_keys.go b/src/e_keys.go
index b386ba4..5396572 100644
--- a/src/e_keys.go
+++ b/src/e_keys.go
@@ -175,6 +175,7 @@ func e_normal_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
ui.insert_method = INSERT_ADD
ui.insert_sel = 0
ui.insert_sel_ok = false
+ ui.insert_scroll = 0
} else if event.Rune() == 'e' &&
data.litems.curr != nil &&
data.litems.curr.is_dir() == false {
@@ -395,6 +396,10 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
} else if ui.insert_sel < ui.insert_sel_max {
ui.insert_sel += 1
}
+ if ui.insert_sel < ui.insert_sel_max &&
+ ui.insert_line + 2 >= ui.insert_win.B - ui.insert_win.T {
+ ui.insert_scroll += 1
+ }
} else if event.Rune() == 'k' ||
event.Key() == tcell.KeyUp {
if data.insert.Protocol == PROTOCOL_RDP &&
@@ -418,6 +423,12 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
} else if ui.insert_sel > INS_PROTOCOL {
ui.insert_sel -= 1
}
+ if ui.insert_sel > INS_PROTOCOL {
+ ui.insert_scroll -= 1
+ if ui.insert_scroll < 0 {
+ ui.insert_scroll = 0
+ }
+ }
} else if event.Rune() == 'g' ||
event.Rune() == 'h' ||
event.Key() == tcell.KeyLeft {