• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisão1270401054d878a753d3323a68f447db837b2ab0 (tree)
Hora2020-11-21 05:15:04
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Mensagem de Log

patch 8.2.2022: Vim9: star command recognized errornously

Commit: https://github.com/vim/vim/commit/95388e3179f6b995dbc4acd3f23e3856bb0286fd
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Nov 20 21:07:00 2020 +0100

patch 8.2.2022: Vim9: star command recognized errornously
Problem: Vim9: star command recognized errornously.
Solution: Give an error for missing colon. (issue https://github.com/vim/vim/issues/7335)

Mudança Sumário

Diff

diff -r a695c4f79964 -r 1270401054d8 src/ex_docmd.c
--- a/src/ex_docmd.c Fri Nov 20 19:30:04 2020 +0100
+++ b/src/ex_docmd.c Fri Nov 20 21:15:04 2020 +0100
@@ -3482,6 +3482,11 @@
34823482 break;
34833483 }
34843484
3485+ // Not not recognize ":*" as the star command unless '*' is in
3486+ // 'cpoptions'.
3487+ if (eap->cmdidx == CMD_star && vim_strchr(p_cpo, CPO_STAR) == NULL)
3488+ p = eap->cmd;
3489+
34853490 // Look for a user defined command as a last resort. Let ":Print" be
34863491 // overruled by a user defined command.
34873492 if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print)
diff -r a695c4f79964 -r 1270401054d8 src/testdir/test_vim9_cmd.vim
--- a/src/testdir/test_vim9_cmd.vim Fri Nov 20 19:30:04 2020 +0100
+++ b/src/testdir/test_vim9_cmd.vim Fri Nov 20 21:15:04 2020 +0100
@@ -634,5 +634,19 @@
634634 CheckScriptSuccess(lines)
635635 enddef
636636
637+def Test_star_command()
638+ var lines =<< trim END
639+ vim9script
640+ @s = 'g:success = 8'
641+ set cpo+=*
642+ exe '*s'
643+ assert_equal(8, g:success)
644+ unlet g:success
645+ set cpo-=*
646+ assert_fails("exe '*s'", 'E1050:')
647+ END
648+ CheckScriptSuccess(lines)
649+enddef
650+
637651
638652 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
diff -r a695c4f79964 -r 1270401054d8 src/version.c
--- a/src/version.c Fri Nov 20 19:30:04 2020 +0100
+++ b/src/version.c Fri Nov 20 21:15:04 2020 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 2022,
755+/**/
754756 2021,
755757 /**/
756758 2020,
Show on old repository browser