1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/edit
Martijn Dekker 143ff27a91 emacs: fix keys w/ repeat parameters repeating extra (re: 29b11bba)
@JohnoKing writes:
> In emacs mode, using Alt+D or Alt+H with a repeat parameter
> results in the deletion of extra characters. Reproducer:
>
> $ set -o emacs
> $ foo bar delete add   # <Ctrl+A> <ESC+3+Alt+D>
> $ d  # Should be ' add'
>
> $ foo bar delete add   # <ESC+3+Alt+H>
> $ f  # Should be 'foo '
>
> [...] this bug also affects the Delete and Arrow keys [...].
> Reproducer:
>
> $ test_string <Ctrl+A> <ESC+3+Delete>
>	# This will delete all of 'test', which is four characters
> $ test_string <Ctrl+A> <ESC+4+Right Arrow>
>	# This should move the cursor to '_', not 's'

src/cmd/ksh93/edit/emacs.c: ed_emacsread():
- Revert part of 29b11bba: once again set 'count' to
  'vt220_save_repeat' instead of adding the value.
- do_escape: If the escape() function (which handles both ESC
  repeat counts and commands like ESC d and ESC h) returns a repeat
  count, do not use the saved repeat count for v220 sequences.

src/cmd/ksh93/tests/pty.sh:
- Test the four reproducers above.

Fixes: https://github.com/ksh93/ksh/issues/292
2021-05-04 05:10:32 +01:00
..
completion.c emacs/vi: Fix <Tab> behaviour after command substitution 2021-05-03 18:49:10 +01:00
edit.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
emacs.c emacs: fix keys w/ repeat parameters repeating extra (re: 29b11bba) 2021-05-04 05:10:32 +01:00
hexpand.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
history.c Parse quotes when extracting words from command history (#291) 2021-04-30 20:18:07 +01:00
vi.c Fix more bugs that occur when enabling ASan (#293) 2021-05-02 04:06:30 +01:00