Skip to content

Commit 3bcfca3

Browse files
committed
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.
1 parent 90d121f commit 3bcfca3

3 files changed

Lines changed: 33 additions & 5 deletions

File tree

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ do_one_cmd(
19541954
#endif
19551955
continue;
19561956
}
1957-
if (!checkforcmd(&ea.cmd, "noswapfile", 6))
1957+
if (!checkforcmd(&ea.cmd, "noswapfile", 3))
19581958
break;
19591959
cmdmod.noswapfile = TRUE;
19601960
continue;

src/testdir/test_usercommands.vim

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,57 @@ function Test_cmdmods()
88

99
MyCmd
1010
aboveleft MyCmd
11+
abo MyCmd
1112
belowright MyCmd
13+
bel MyCmd
1214
botright MyCmd
15+
bo MyCmd
1316
browse MyCmd
17+
bro MyCmd
1418
confirm MyCmd
19+
conf MyCmd
1520
hide MyCmd
21+
hid MyCmd
1622
keepalt MyCmd
23+
keepa MyCmd
1724
keepjumps MyCmd
25+
keepj MyCmd
1826
keepmarks MyCmd
27+
kee MyCmd
1928
keeppatterns MyCmd
29+
keepp MyCmd
30+
leftabove MyCmd " results in :aboveleft
31+
lefta MyCmd
2032
lockmarks MyCmd
33+
loc MyCmd
34+
" noautocmd MyCmd
2135
noswapfile MyCmd
36+
nos MyCmd
37+
rightbelow MyCmd " results in :belowright
38+
rightb MyCmd
39+
" sandbox MyCmd
2240
silent MyCmd
41+
sil MyCmd
2342
tab MyCmd
2443
topleft MyCmd
44+
to MyCmd
45+
" unsilent MyCmd
2546
verbose MyCmd
47+
verb MyCmd
2648
vertical MyCmd
49+
vert MyCmd
2750

2851
aboveleft belowright botright browse confirm hide keepalt keepjumps
2952
\ keepmarks keeppatterns lockmarks noswapfile silent tab
3053
\ topleft verbose vertical MyCmd
3154

32-
call assert_equal(' aboveleft belowright botright browse confirm ' .
33-
\ 'hide keepalt keepjumps keepmarks keeppatterns lockmarks ' .
34-
\ 'noswapfile silent tab topleft verbose vertical aboveleft ' .
35-
\ 'belowright botright browse confirm hide keepalt keepjumps ' .
55+
call assert_equal(' aboveleft aboveleft belowright belowright botright ' .
56+
\ 'botright browse browse confirm confirm hide hide ' .
57+
\ 'keepalt keepalt keepjumps keepjumps keepmarks keepmarks ' .
58+
\ 'keeppatterns keeppatterns aboveleft aboveleft lockmarks lockmarks noswapfile ' .
59+
\ 'noswapfile belowright belowright silent silent tab topleft topleft verbose verbose ' .
60+
\ 'vertical vertical ' .
61+
\ 'aboveleft belowright botright browse confirm hide keepalt keepjumps ' .
3662
\ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' .
3763
\ 'verbose vertical ', g:mods)
3864

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2127,
766768
/**/
767769
2126,
768770
/**/

0 commit comments

Comments
 (0)