aboutsummaryrefslogtreecommitdiffstats
path: root/src/e_keys.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-05-10 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-05-10 20:20:20 +0200
commit6c5d7510a9e874d29a7576fd5b9fafdd6fd15ab8 (patch)
tree81e45eb08f7b8368d76f289b90654f65921558b0 /src/e_keys.go
parenthey (diff)
downloadhardflip-6c5d7510a9e874d29a7576fd5b9fafdd6fd15ab8.tar.gz
hardflip-6c5d7510a9e874d29a7576fd5b9fafdd6fd15ab8.tar.bz2
hardflip-6c5d7510a9e874d29a7576fd5b9fafdd6fd15ab8.tar.xz
hardflip-6c5d7510a9e874d29a7576fd5b9fafdd6fd15ab8.tar.zst
hardflip-6c5d7510a9e874d29a7576fd5b9fafdd6fd15ab8.zip
dirt but eh fuck it works
Diffstat (limited to '')
-rw-r--r--src/e_keys.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/e_keys.go b/src/e_keys.go
index e1ea768..d513a4e 100644
--- a/src/e_keys.go
+++ b/src/e_keys.go
@@ -397,8 +397,9 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
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
+ ui.insert_sel % 2 == 0 &&
+ ui.insert_butt == false {
+ ui.insert_scroll += 2
// TODO: gogo
}
} else if event.Rune() == 'k' ||
@@ -424,8 +425,8 @@ 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_sel % 2 == 0 {
+ ui.insert_scroll -= 2
if ui.insert_scroll < 0 {
ui.insert_scroll = 0
}