fix(viewport): normalize method names (#763)

* Reapply "fix(viewport): normalize method names"

This reverts commit f2434c374b.

* test: fixes

* fix: lint

* fix: disable horizontal scroll on v1

it might be a breaking change.

let's enable it by default on v2, and remove the deprecated methods as
well.

cc/ @meowgorithm

* fix: simplify
This commit is contained in:
Carlos Alexandro Becker
2025-03-27 16:11:34 -03:00
committed by GitHub
parent f2434c374b
commit 39668ec629
4 changed files with 128 additions and 82 deletions
+2 -2
View File
@@ -857,9 +857,9 @@ func (m *Model) repositionView() {
maximum := minimum + m.viewport.Height - 1
if row := m.cursorLineNumber(); row < minimum {
m.viewport.LineUp(minimum - row)
m.viewport.ScrollUp(minimum - row)
} else if row > maximum {
m.viewport.LineDown(row - maximum)
m.viewport.ScrollDown(row - maximum)
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ func TestVerticalScrolling(t *testing.T) {
"the text area.",
}
for _, line := range lines {
textarea.viewport.LineDown(1)
textarea.viewport.ScrollDown(1)
view = textarea.View()
if !strings.Contains(view, line) {
t.Log(view)