diff --git a/NEWS b/NEWS index e1602b007..fecc39850 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ Any uppercase BUG_* names are modernish shell bug IDs. 2021-02-15: +- Fixed a bug in the emacs built-in editor, introduced on 2020-09-17, that + made the Meta-D and Meta-H keys delete single characters instead of words. + - A new 'backslashctrl' shell option has been added. It is on by default. Turning it off (set +o backslashctrl or set --nobackslashctrl) disables the special escaping behaviour of the backslash character in the emacs and vi diff --git a/src/cmd/ksh93/edit/emacs.c b/src/cmd/ksh93/edit/emacs.c index cefb4b033..b5e483645 100644 --- a/src/cmd/ksh93/edit/emacs.c +++ b/src/cmd/ksh93/edit/emacs.c @@ -318,13 +318,13 @@ int ed_emacsread(void *context, int fd,char *buff,int scend, int reedit) killing = 0; #endif oadjust = count = adjust; - if(vt220_save_repeat) - { - count = vt220_save_repeat; - vt220_save_repeat = 0; - } if(count<0) count = 1; + if(vt220_save_repeat>0) + { + count += vt220_save_repeat; + vt220_save_repeat = 0; + } adjust = -1; i = cur; if(c!='\t' && c!=ESC && !digit(c))