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+Arrow to invert accelerated mode for single navigation #323

Closed ProgerXP closed 1 year ago

ProgerXP commented 3 years ago

Is it possible to hook two Alt+Arrows (Left and Right) combinations so that they don't trigger any side effects? Asking because Alt is used for &accelerators (main menu, etc.) and it often conflicts in other programs.

If yes then make them move caret as if WordNavigationMode (#89) was inverted. For example, by default Ctrl+Arrow Left moves to the preceding word while Alt+Arrow Left would move to the preceding whitespace. If WordNavigationMode is enabled then Ctrl+Left moves to whitespace and Alt+Left - to word. Ctrl+Alt+Arrow are not affected by this change.

This is like vim's word/WORD motions, e.g. w (word, move by word symbols) and W (WORD, move by whitespace).

cshnik commented 3 years ago

Please consider changes (committed to temporary branch) related to Scintilla code required for feature implementation.

ProgerXP commented 3 years ago

This works extremely well.

Add processing of Alt+Shift+Arrow by analogy with Ctrl+Shift+Arrow, i.e. in addition to moving caret make it select the text.

cshnik commented 3 years ago

Done.

ProgerXP commented 3 years ago

Great. Merge the branch if ready and delete it.

cshnik commented 3 years ago

Great. Merge the branch if ready and delete it.

Done.

ProgerXP commented 3 years ago

Let's add two more similar hotkeys:

cshnik commented 2 years ago

Let's add two more similar hotkeys:

  • Alt+Backspace (bW in Vim) - like Ctrl+Backspace, with inverted WordNavigationMode

    • Notepad2 is using it for Undo, remove this binding
  • Alt+Delete (dW in Vim) - like Ctrl+Delete, with inverted WordNavigationMode

Done.

ProgerXP commented 2 years ago

Works but Alt+Backspace produces an audible "beep", as if Windows tries to execute a non-existing hotkey.

cshnik commented 2 years ago

Works but Alt+Backspace produces an audible "beep", as if Windows tries to execute a non-existing hotkey.

Fixed.

ProgerXP commented 1 year ago

Let's add two more similar hotkeys:

Must conform to #348.

cshnik commented 1 year ago

Done. Alt+Backspace/Delete works for current selection (if any).