aboutsummaryrefslogtreecommitdiffstats
path: root/i_ui.go
diff options
context:
space:
mode:
Diffstat (limited to 'i_ui.go')
-rw-r--r--i_ui.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/i_ui.go b/i_ui.go
index f3f042a..c2b116a 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -72,14 +72,13 @@ type HardUI struct {
dim [2]int
}
-func (ui *HardUI) inc_sel(n int) {
- ui.line += n
- if ui.line < 1 {
- ui.line = 1
- }
- if ui.line >= ui.sel_max {
- ui.line = ui.sel_max - 1
+func (ui *HardUI) inc_sel(n int, data *HardData) {
+ if ui.line + n < 1 ||
+ ui.line + n >= ui.sel_max {
+ n = 0
}
+ ui.line += n
+ data.sel_unique_id(ui.line)
if ui.line > ui.list_start + ui.dim[H] - 4 {
ui.list_start = (ui.line + 1) - (ui.dim[H] + 3)
} else if ui.line < ui.list_start {