ProgerXP / Notepad2e

Word highlighting, simultaneous editing, split views, math evaluation, un/grep, comment reformatting, UAC elevation, complete regexps (PCRE), Lua lexers, DPI awareness and more (XP+)
Other
372 stars 52 forks source link

Alt+PageUp/PageDown to move caret to page top/bottom #433

Closed ProgerXP closed 10 months ago

ProgerXP commented 1 year ago

This is like H L M in Vim.

The hotkeys put caret on the first/last line that would not cause scrolling as a result of ScrollYCaretPolicy.

For example, if currently visible lines are:

first
second
third
fourth
fifth
sixth

Assume ScrollYCaretPolicy is as such that when caret is on line 1 then page is scrolled but not if on line 2 or below. In this case Alt+PageUp would place caret on line second (and the original column) while Alt+PageDown - on fifth.

cshnik commented 1 year ago

Done.

ProgerXP commented 1 year ago

Works only if there are no wrapped lines - otherwise caret position is calculated incorrectly.

cshnik commented 1 year ago

Fixed.

ProgerXP commented 1 year ago

This works. Let's add Shift+Alt+PageUp/Down that make/extend selection to the start of target line (currently they work like normal Shift+PageUp/Down).

cshnik commented 1 year ago

Done.

ProgerXP commented 10 months ago

Minor/future issue: this currently sets caret to the first subline so if there's a long wrapped line on top of the screen whose leading sublines are invisible, Alt+PageUp will actually scroll the viewport.