PageUp/PageDown does not scroll exact one page when using WordWrap #253

Open
opened 2020-12-02 15:09:46 -06:00 by pavolbutora · 1 comment
pavolbutora commented 2020-12-02 15:09:46 -06:00 (Migrated from github.com)

When navigating through keys PageUp/PageDown and text in “VisualLines” contains wrapped lines, next scrolled page does not continue where previous finished (e.g. last line in previous page was 10 and first line in next page is 15). Cursor is below the current view area and therefore scroll is further as expected. Test performed in ICSharpCode.AvalonEdit.Sample.exe (WordWrap = true).

I’m I missing something, or is there any workaround how to keyboard scroll exact page (the same way like scroll through scrollviewer)?

Best regards,
Paul

When navigating through keys PageUp/PageDown and text in “VisualLines” contains wrapped lines, next scrolled page does not continue where previous finished (e.g. last line in previous page was 10 and first line in next page is 15). Cursor is below the current view area and therefore scroll is further as expected. Test performed in ICSharpCode.AvalonEdit.Sample.exe (WordWrap = true). I’m I missing something, or is there any workaround how to keyboard scroll exact page (the same way like scroll through scrollviewer)? Best regards, Paul
pavolbutora commented 2021-07-30 15:17:42 -05:00 (Migrated from github.com)

Additional clarification:
Wrong page scroll occurs when visual lines are presented for the first time. If user navigates at the beginning of the document (e.g. CTRL+Home) and scroll again to previous place the caret is pointed correctly. If user wants scroll again and the cursor is again positioned incorrectly than operation (navigation top CTRL+Home and back) will correct last wrong caret position.
I found UpdateAugmentedData() returns different node Height in case the line was already presented in visual lines. Because of this, method textView.GetDocumentLineByVisualTop(yPos1) (in method GetUpDownCaretPosition in class CaretNavigationCommandHandler) calculates wrong desired line number and therefore caret is on wrong place.

Unfortunately I don't understand everything to provide additional information.

Additional clarification: Wrong page scroll occurs when visual lines are presented for the first time. If user navigates at the beginning of the document (e.g. CTRL+Home) and scroll again to previous place the caret is pointed correctly. If user wants scroll again and the cursor is again positioned incorrectly than operation (navigation top CTRL+Home and back) will correct last wrong caret position. I found UpdateAugmentedData() returns different node Height in case the line was already presented in visual lines. Because of this, method textView.GetDocumentLineByVisualTop(yPos1) (in method GetUpDownCaretPosition in class CaretNavigationCommandHandler) calculates wrong desired line number and therefore caret is on wrong place. Unfortunately I don't understand everything to provide additional information.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-icsharpcode/AvalonEdit#253
No description provided.