To: vim_dev@googlegroups.com Subject: Patch 9.0.0234 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0234 Problem: Cannot make difference between the end of :normal and a character in its argument. Solution: Add the "typebuf_was_empty" flag. (closes #10950) Files: src/getchar.c, src/globals.h, src/normal.c *** ../vim-9.0.0233/src/getchar.c 2022-08-14 14:16:07.987582278 +0100 --- src/getchar.c 2022-08-21 10:28:59.269042696 +0100 *************** *** 3056,3062 **** --- 3056,3065 ---- ++vgetc_busy; if (advance) + { KeyStuffed = FALSE; + typebuf_was_empty = FALSE; + } init_typebuf(); start_stuff(); *************** *** 3361,3366 **** --- 3364,3373 ---- #ifdef FEAT_CMDWIN tc = c; #endif + // set a flag to indicate this wasn't a normal char + if (advance) + typebuf_was_empty = TRUE; + // return from main_loop() if (pending_exmode_active) exmode_active = EXMODE_NORMAL; *** ../vim-9.0.0233/src/globals.h 2022-08-16 17:50:33.959764427 +0100 --- src/globals.h 2022-08-21 10:07:27.814771247 +0100 *************** *** 1206,1211 **** --- 1206,1215 ---- = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0} #endif ; + // Flag used to indicate that vgetorpeek() returned a char like Esc when the + // :normal argument was exhausted. + EXTERN int typebuf_was_empty INIT(= FALSE); + EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal() #ifdef FEAT_EVAL EXTERN int in_feedkeys INIT(= 0); // ex_normal_busy set in feedkeys() *** ../vim-9.0.0233/src/normal.c 2022-08-16 20:23:57.398232761 +0100 --- src/normal.c 2022-08-21 10:38:57.723990505 +0100 *************** *** 6808,6818 **** #endif } #ifdef FEAT_CMDWIN ! else if (cmdwin_type != 0 && ex_normal_busy) { // When :normal runs out of characters while in the command line window ! // vgetorpeek() will return ESC. Exit the cmdline window to break the ! // loop. cmdwin_result = K_IGNORE; return; } --- 6808,6818 ---- #endif } #ifdef FEAT_CMDWIN ! else if (cmdwin_type != 0 && ex_normal_busy && typebuf_was_empty) { // When :normal runs out of characters while in the command line window ! // vgetorpeek() will repeatedly return ESC. Exit the cmdline window to ! // break the loop. cmdwin_result = K_IGNORE; return; } *** ../vim-9.0.0233/src/version.c 2022-08-20 20:54:44.262968041 +0100 --- src/version.c 2022-08-21 10:39:35.935939560 +0100 *************** *** 733,734 **** --- 733,736 ---- { /* Add new patch number below this line */ + /**/ + 234, /**/ -- Life is a gift, living is an art. (Bram Moolenaar) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///