From d8da2fba6d4c25a1c53cf2e6964cb5e1449a65c5 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Wed, 6 Aug 2025 11:35:31 +0200 Subject: [PATCH] chore: handle smaller text than screen size --- internal/tui/exp/list/list.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/tui/exp/list/list.go b/internal/tui/exp/list/list.go index d40f8d26128eef0d6930ff598c4aa21b971fd75e..595e21334d37b218f3d4fc8892cd03e4a1010d41 100644 --- a/internal/tui/exp/list/list.go +++ b/internal/tui/exp/list/list.go @@ -1294,7 +1294,7 @@ func (l *list[T]) findWordBoundaries(col, line int) (startCol, endCol int) { lines[i] = ansi.Strip(l) } - if l.direction == DirectionBackward { + if l.direction == DirectionBackward && len(lines) > l.height { line = ((len(lines) - 1) - l.height) + line + 1 } @@ -1336,7 +1336,7 @@ func (l *list[T]) findParagraphBoundaries(line int) (startLine, endLine int, fou lines[i] = strings.ReplaceAll(lines[i], icon, " ") } } - if l.direction == DirectionBackward { + if l.direction == DirectionBackward && len(lines) > l.height { line = (len(lines) - 1) - l.height + line + 1 } @@ -1370,7 +1370,7 @@ func (l *list[T]) findParagraphBoundaries(line int) (startLine, endLine int, fou } // revert the line numbers if we are in backward direction - if l.direction == DirectionBackward { + if l.direction == DirectionBackward && len(lines) > l.height { startLine = startLine - (len(lines) - 1) + l.height - 1 endLine = endLine - (len(lines) - 1) + l.height - 1 }