on main help sign in
chore: handle smaller text than screen size
commitd8da2fba6d4c25a1c53cf2e6964cb5e1449a65c5 authorKujtim Hoxha <kujtimii.h@gmail.com> dateWed 6 Aug 2025, 11:35 (1 year ago) parent77ac083
1 file changed+3−3
internal/tui/exp/list/list.go+3−3
internal/tui/exp/list/list.go+3−3
@@ -1294,7 +1294,7 @@ func (l *list[T]) findWordBoundaries(col, line int) (startCol, endCol int) {
12941294 lines[i] = ansi.Strip(l)
12951295 }
12961296
1297− if l.direction == DirectionBackward {
1297+ if l.direction == DirectionBackward && len(lines) > l.height {
12981298 line = ((len(lines) - 1) - l.height) + line + 1
12991299 }
13001300
@@ -1336,7 +1336,7 @@ func (l *list[T]) findParagraphBoundaries(line int) (startLine, endLine int, fou
13361336 lines[i] = strings.ReplaceAll(lines[i], icon, " ")
13371337 }
13381338 }
1339− if l.direction == DirectionBackward {
1339+ if l.direction == DirectionBackward && len(lines) > l.height {
13401340 line = (len(lines) - 1) - l.height + line + 1
13411341 }
13421342
@@ -1370,7 +1370,7 @@ func (l *list[T]) findParagraphBoundaries(line int) (startLine, endLine int, fou
13701370 }
13711371
13721372 // revert the line numbers if we are in backward direction
1373− if l.direction == DirectionBackward {
1373+ if l.direction == DirectionBackward && len(lines) > l.height {
13741374 startLine = startLine - (len(lines) - 1) + l.height - 1
13751375 endLine = endLine - (len(lines) - 1) + l.height - 1
13761376 }