mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user