Mirror of the Vim source from https://github.com/vim/vim
Revisão | 1270401054d878a753d3323a68f447db837b2ab0 (tree) |
---|---|
Hora | 2020-11-21 05:15:04 |
Autor | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
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
@@ -3482,6 +3482,11 @@ | ||
3482 | 3482 | break; |
3483 | 3483 | } |
3484 | 3484 | |
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 | + | |
3485 | 3490 | // Look for a user defined command as a last resort. Let ":Print" be |
3486 | 3491 | // overruled by a user defined command. |
3487 | 3492 | if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print) |
@@ -634,5 +634,19 @@ | ||
634 | 634 | CheckScriptSuccess(lines) |
635 | 635 | enddef |
636 | 636 | |
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 | + | |
637 | 651 | |
638 | 652 | " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |
@@ -751,6 +751,8 @@ | ||
751 | 751 | static int included_patches[] = |
752 | 752 | { /* Add new patch number below this line */ |
753 | 753 | /**/ |
754 | + 2022, | |
755 | +/**/ | |
754 | 756 | 2021, |
755 | 757 | /**/ |
756 | 758 | 2020, |