vim-patch:7.4.2127

Problem:    The short form of ":noswapfile" is ":noswap" instead of ":now".
            (Kent Sibilev)
Solution:   Only require three characters.  Add a test for the short forms.

3bcfca3ab4
This commit is contained in:
rover 2017-01-05 20:22:07 +08:00
parent e21aef1e10
commit 9da9e1c417
3 changed files with 32 additions and 6 deletions

View File

@ -1374,7 +1374,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
} }
continue; continue;
} }
if (!checkforcmd(&ea.cmd, "noswapfile", 6)) { if (!checkforcmd(&ea.cmd, "noswapfile", 3)) {
break; break;
} }
cmdmod.noswapfile = true; cmdmod.noswapfile = true;

View File

@ -8,31 +8,57 @@ function Test_cmdmods()
MyCmd MyCmd
aboveleft MyCmd aboveleft MyCmd
abo MyCmd
belowright MyCmd belowright MyCmd
bel MyCmd
botright MyCmd botright MyCmd
bo MyCmd
browse MyCmd browse MyCmd
bro MyCmd
confirm MyCmd confirm MyCmd
conf MyCmd
hide MyCmd hide MyCmd
hid MyCmd
keepalt MyCmd keepalt MyCmd
keepa MyCmd
keepjumps MyCmd keepjumps MyCmd
keepj MyCmd
keepmarks MyCmd keepmarks MyCmd
kee MyCmd
keeppatterns MyCmd keeppatterns MyCmd
keepp MyCmd
leftabove MyCmd " results in :aboveleft
lefta MyCmd
lockmarks MyCmd lockmarks MyCmd
loc MyCmd
" noautocmd MyCmd
noswapfile MyCmd noswapfile MyCmd
nos MyCmd
rightbelow MyCmd " results in :belowright
rightb MyCmd
" sandbox MyCmd
silent MyCmd silent MyCmd
sil MyCmd
tab MyCmd tab MyCmd
topleft MyCmd topleft MyCmd
to MyCmd
" unsilent MyCmd
verbose MyCmd verbose MyCmd
verb MyCmd
vertical MyCmd vertical MyCmd
vert MyCmd
aboveleft belowright botright browse confirm hide keepalt keepjumps aboveleft belowright botright browse confirm hide keepalt keepjumps
\ keepmarks keeppatterns lockmarks noswapfile silent tab \ keepmarks keeppatterns lockmarks noswapfile silent tab
\ topleft verbose vertical MyCmd \ topleft verbose vertical MyCmd
call assert_equal(' aboveleft belowright botright browse confirm ' . call assert_equal(' aboveleft aboveleft belowright belowright botright ' .
\ 'hide keepalt keepjumps keepmarks keeppatterns lockmarks ' . \ 'botright browse browse confirm confirm hide hide ' .
\ 'noswapfile silent tab topleft verbose vertical aboveleft ' . \ 'keepalt keepalt keepjumps keepjumps keepmarks keepmarks ' .
\ 'belowright botright browse confirm hide keepalt keepjumps ' . \ 'keeppatterns keeppatterns aboveleft aboveleft lockmarks lockmarks noswapfile ' .
\ 'noswapfile belowright belowright silent silent tab topleft topleft verbose verbose ' .
\ 'vertical vertical ' .
\ 'aboveleft belowright botright browse confirm hide keepalt keepjumps ' .
\ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' . \ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' .
\ 'verbose vertical ', g:mods) \ 'verbose vertical ', g:mods)

View File

@ -313,7 +313,7 @@ static int included_patches[] = {
// 2130 NA // 2130 NA
// 2129 NA // 2129 NA
2128, 2128,
// 2127, 2127,
2126, 2126,
// 2125 NA // 2125 NA
2124, 2124,