Conversation
This reverts commit f2434c3.
There was a problem hiding this comment.
Pull Request Overview
This PR normalizes the naming of viewport scrolling methods and deprecates legacy functions in favor of the new naming conventions. Key changes include:
- Renaming methods (e.g. ViewDown/ViewUp to PageDown/PageUp) and internally routing to ScrollDown/ScrollUp.
- Updating deprecation comments and removing legacy horizontal scrolling methods.
- Adjusting test cases to align with the new method names and expected behavior.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| viewport/viewport.go | Normalizes scrolling method names and updates deprecation comments. |
| viewport/viewport_test.go | Updates tests to use the new ScrollLeft/ScrollRight methods and expectations. |
| textarea/textarea.go | Updates repositionView to call ScrollUp/ScrollDown instead of legacy methods. |
| textarea/textarea_test.go | Updates tests to call ScrollDown in place of deprecated methods. |
Comments suppressed due to low confidence (2)
viewport/viewport.go:198
- [nitpick] The PR introduces both 'PageDown' and 'ScrollDown' naming for scrolling functions; consider further unification to avoid potential confusion among users, as the PR description hints at possibly unifying these names.
return m.ScrollDown(m.Height)
viewport/viewport_test.go:287
- The expected output for the last visible line in TestVisibleLines changed from '...' to an empty string; please verify that this behavior change is intentional.
if list[lastItem] != "" {
it might be a breaking change. let's enable it by default on v2, and remove the deprecated methods as well. cc/ @meowgorithm
There was a problem hiding this comment.
Pull Request Overview
This PR normalizes the method names for scrolling operations in the viewport and textarea packages. Key changes include renaming scrolling methods (e.g. replacing MoveLeft/MoveRight with ScrollLeft/ScrollRight, and ViewUp/ViewDown with PageUp/PageDown), deprecating legacy high performance rendering functions, and updating tests accordingly.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| viewport/viewport_test.go | Updated tests to use new Scroll* and Page* methods and removed deprecated calls |
| viewport/viewport.go | Renamed and deprecated scrolling methods; updated inline documentation |
| textarea/textarea_test.go | Adjusted tests to call ScrollDown instead of LineDown |
| textarea/textarea.go | Updated scrolling calls to use ScrollUp/ScrollDown as needed |
Comments suppressed due to low confidence (2)
viewport/viewport_test.go:17
- [nitpick] Consider using the SetHorizontalStep method instead of setting m.horizontalStep directly to align test code with production code conventions.
m.horizontalStep = defaultHorizontalStep // remove on v2
viewport/viewport_test.go:296
- Verify that expecting an empty string as the last item is intentional; the previous test expected '...' which might indicate a mismatch in behavior versus test expectations.
if list[lastItem] != "" {
Scroll<direction>ViewUpet al to what they actually do (PageUp,HalfPageUp, etc)ResetHorizontalScrollas we haveSetXOffsetMaybeDecided not to do this.SetXOffsetandSetYOffsetshould be unified inSetScroll(x, y)?Also, should horizontal scroll be disabled by default? (currently isn't) - ✅ done