update tests - #239
update tests#239
Conversation
maxistar
commented
Sep 14, 2026
- fix unit tests
- improve UI for navigation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e479301275
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case MotionEvent.ACTION_POINTER_UP: | ||
| if (panningActive) { | ||
| view.getParent().requestDisallowInterceptTouchEvent(false); | ||
| } | ||
| return panningActive; | ||
| return stopPanning(view); |
There was a problem hiding this comment.
Keep consuming events after ending a two-finger pan
When either finger is released, stopPanning() clears panningActive, so the remaining ACTION_UP is returned as unhandled and reaches EditText.onTouchEvent(). Because the editor already received the original ACTION_DOWN but not the consumed pan movements, lifting the last finger after a two-finger scroll can be interpreted as a tap and unexpectedly move the caret or alter the selection. Stop scrolling on ACTION_POINTER_UP, but keep consuming the gesture until its final ACTION_UP or ACTION_CANCEL.
Useful? React with 👍 / 👎.
| float maxLineWidth = 0; | ||
| for (int line = 0; line < layout.getLineCount(); line++) { | ||
| maxLineWidth = Math.max(maxLineWidth, layout.getLineWidth(line)); |
There was a problem hiding this comment.
Avoid scanning every line when a pan begins
For large documents, placing the second finger now iterates through every layout line on the UI thread before any panning can occur. Since this scan runs at the start of every two-finger gesture, files with hundreds of thousands of lines can visibly freeze the editor whenever the user begins scrolling; cache the maximum width and invalidate it when the text or layout changes instead of recomputing it per gesture.
Useful? React with 👍 / 👎.
…s_pr_fix fix code review suggestions