Skip to content

input: readline-style editing keys; formatting accels move to Alt - #7

Open
rubinlinux wants to merge 1 commit into
masterfrom
readline-input-keys
Open

input: readline-style editing keys; formatting accels move to Alt#7
rubinlinux wants to merge 1 commit into
masterfrom
readline-input-keys

Conversation

@rubinlinux

Copy link
Copy Markdown
Member

Adds Emacs/readline-style editing bindings to the custom input widget (hex-input-edit):

  • Ctrl-A / Ctrl-E — move to start / end of line
  • Ctrl-B / Ctrl-F — move one character left / right
  • Ctrl-U / Ctrl-K — kill to start / end of line
  • Ctrl-W — delete previous word
  • Ctrl-D — delete next character
  • Ctrl-/ — select all (moves from Ctrl-A)

Kill operations go through a new delete_range_bytes() helper that takes an undo snapshot and fixes up the cursor/selection.

Since Ctrl-O/B/K/I/U/R are now claimed by editing keys, the default IRC formatting-code accelerators (reset, bold, color, italic, underline, reverse) move to Alt-O/B/K/I/U/R in fkeys.c.

Note for existing installs

The fkeys.c change only affects the default keybinding set. Users with a saved keybindings config will keep the old Ctrl accelerators, which may shadow the new readline keys depending on which handler wins — worth a manual test with a pre-existing config before merge.

Add Emacs/readline bindings to the input widget: Ctrl-A/E move to
start/end of line, Ctrl-B/F move by character, Ctrl-U/K kill to
start/end, Ctrl-W deletes the previous word, Ctrl-D deletes the next
character. Kills go through a new delete_range_bytes() helper that
takes an undo snapshot and fixes up the cursor. Select-all moves from
Ctrl-A to Ctrl-/.

Since Ctrl-O/B/K/I/U/R are now claimed by the editing keys, move the
default IRC formatting-code accelerators (reset, bold, color, italic,
underline, reverse) to Alt-O/B/K/I/U/R.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant