Patch 8.2.2851
Problem: Using <Cmd> mapping on the command line triggers CmdlineChanged.
(Naohiro Ono)
Solution: Jump to cmdline_not_changed if the command line didn't change.
(closes #8208)
Files: src/ex_getln.c, src/testdir/test_cmdline.vim
*** ../vim-8.2.2850/src/ex_getln.c 2021-04-08 18:27:49.525472168 +0200
--- src/ex_getln.c 2021-05-15 13:13:50.605100003 +0200
***************
*** 1757,1765 ****
c = safe_vgetc();
} while (c == K_IGNORE || c == K_NOP);
! if (c == K_COMMAND
! && do_cmdline(NULL, getcmdkeycmd, NULL, DOCMD_NOWAIT) == OK)
! goto cmdline_changed;
if (KeyTyped)
{
--- 1757,1773 ----
c = safe_vgetc();
} while (c == K_IGNORE || c == K_NOP);
! if (c == K_COMMAND)
! {
! int clen = ccline.cmdlen;
!
! if (do_cmdline(NULL, getcmdkeycmd, NULL, DOCMD_NOWAIT) == OK)
! {
! if (clen == ccline.cmdlen)
! goto cmdline_not_changed;
! goto cmdline_changed;
! }
! }
if (KeyTyped)
{
*** ../vim-8.2.2850/src/testdir/test_cmdline.vim 2021-05-13
20:23:04.010299670 +0200
--- src/testdir/test_cmdline.vim 2021-05-15 13:12:50.641335598 +0200
***************
*** 1799,1802 ****
--- 1799,1821 ----
cunmap <Plug>(save-cmdline)
endfunc
+ func Test_cmd_map_cmdlineChanged()
+ let g:log = []
+ cnoremap <F1> l<Cmd><CR>s
+ augroup test
+ autocmd!
+ autocmd CmdlineChanged : let g:log += [getcmdline()]
+ augroup END
+
+ call feedkeys(":\<F1>\<CR>", 'xt')
+ call assert_equal(['l', 'ls'], g:log)
+
+ unlet g:log
+ cunmap <F1>
+ augroup test
+ autocmd!
+ augroup END
+ endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2850/src/version.c 2021-05-13 20:23:04.010299670 +0200
--- src/version.c 2021-05-15 12:50:13.266895661 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2851,
/**/
--
ARTHUR: Right! Knights! Forward!
ARTHUR leads a charge toward the castle. Various shots of them battling on,
despite being hit by a variety of farm animals.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202105151120.14FBK5fT3276276%40masaka.moolenaar.net.