Skip to content

Commit aa979c7

Browse files
h-eastchrisbra
authored andcommitted
patch 9.1.0985: Vim9: some ex commands can be shortened
Problem: Vim9: some ex commands can be shortened Solution: disallow shortening of :abstract, :interface and :type (h-east) closes: #16356 Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 663d18d commit aa979c7

11 files changed

Lines changed: 101 additions & 20 deletions

runtime/syntax/generator/gen_syntax_vim.vim

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,34 @@ function s:parse_vim_command(cmd)
194194
let item.syn_str = item.name
195195
call add(a:cmd, copy(item))
196196

197-
" ":fina" means ":finally" in legacy script, for backwards compatibility.
198-
" (From Vim source code find_ex_command() in ex_docmd.c)
197+
let no_shorten_in_vim9 =<< trim EOL
198+
final
199+
def
200+
enddef
201+
class
202+
endclass
203+
enum
204+
endenum
205+
interface
206+
endinterface
207+
abstract
208+
public
209+
static
210+
this
211+
var
212+
type
213+
EOL
214+
199215
call map(a:cmd, {_, v ->
200-
\ v.name ==# 'final' ?
216+
\ index(no_shorten_in_vim9, v.name) != -1 ?
201217
\ extend(copy(v), {'omit_idx': -1, 'syn_str': v.name}) :
218+
"\ ":fina" means ":finally" in legacy script, for backwards compatibility.
219+
"\ (From Vim source code find_ex_command() in ex_docmd.c)
202220
\ v.name ==# 'finally' ?
203221
\ extend(copy(v), {'omit_idx': 3, 'syn_str': 'fina[lly]'}) :
222+
"\ :ho must not be recognized as :horizontal.
223+
\ v.name ==# 'horizontal' ?
224+
\ extend(copy(v), {'omit_idx': 2, 'syn_str': 'hor[izontal]'}) :
204225
\ v
205226
\ })
206227

@@ -233,6 +254,7 @@ function s:get_vim_command_type(cmd_name)
233254
Next
234255
Print
235256
X
257+
abstract
236258
append
237259
augroup
238260
augroup
@@ -715,6 +737,29 @@ function s:check_help_doc(vim_info)
715737
i
716738
END
717739

740+
let nocheck_shorten_excmd_list =<< trim END
741+
bufdo
742+
cfdo
743+
cstag
744+
debug
745+
defer
746+
eval
747+
intro
748+
lfdo
749+
luado
750+
luafile
751+
ownsyntax
752+
py3do
753+
pydo
754+
pyxdo
755+
pyxfile
756+
rundo
757+
smile
758+
syntime
759+
windo
760+
wundo
761+
END
762+
718763
" Check the Ex-command is listed in index.txt
719764
split index.txt
720765
for vimcmd in a:vim_info.cmd
@@ -750,8 +795,8 @@ function s:check_help_doc(vim_info)
750795
call s:err_sanity($'Help tag for Ex-cmd ":{vimcmd.name}" not found.')
751796
elseif len(qfl) > 1
752797
call s:err_sanity($'Help tag for Ex-cmd ":{vimcmd.name}" is duplicated.')
753-
else
754-
" Check the existence of Ex-command notation.
798+
elseif index(nocheck_shorten_excmd_list, vimcmd.name) ==# -1
799+
" Check the existence of the shorten Ex-command notation.
755800
cc
756801
norm! 2k
757802
let end_lnum = qfl[0].lnum + 10
@@ -778,7 +823,9 @@ function s:check_help_doc(vim_info)
778823
call s:err_gen('')
779824
throw 'exit'
780825
finally
826+
call s:err_gen('Ex-cmd documentation consistency check completed.')
781827
exec 'cd ' . cwd_save
828+
set wildignore&
782829
endtry
783830
endfunc
784831

runtime/syntax/testdir/dumps/vim9_ex_commands_01.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
>:|a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&@63
77
|:|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&@66
88
|:|a+0#af5f00255&|b|o|v|e|l|e|f|t| +0#0000000&@64
9-
|:|a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@65
9+
|:|a|b|s|t|r|a|c|t| @65
1010
|:|a+0#af5f00255&|l@1| +0#0000000&@70
1111
|:|a+0#af5f00255&|m|e|n|u| +0#0000000&@68
1212
|:|a+0#af5f00255&|n|o|r|e|m|e|n|u| +0#0000000&@64

runtime/syntax/testdir/dumps/vim9_ex_commands_33.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&@56
1414
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&@59
1515
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|o|v|e|l|e|f|t| +0#0000000&@57
16-
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@58
16+
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a|b|s|t|r|a|c|t| @58
1717
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|l@1| +0#0000000&@63
1818
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|m|e|n|u| +0#0000000&@61
1919
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|n|o|r|e|m|e|n|u| +0#0000000&@57

runtime/syntax/testdir/dumps/vim_ex_commands_65.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
@75
1717
|"+0#0000e05&| |V|i|m|9|-|s|c|r|i|p|t| |o|n|l|y| +0#0000000&@56
1818
@75
19-
|:|a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@65
19+
|:|a|b|s|t|r|a|c|t| @65
2020
@57|1@1|7|1|,|1| @7|9|7|%|

runtime/syntax/testdir/dumps/vim_ex_commands_66.dump

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|:+0&#ffffff0|a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@65
1+
|:+0&#ffffff0|a|b|s|t|r|a|c|t| @65
22
|:|c|l|a|s@1| @68
33
|:|e|n|d|c|l|a|s@1| @65
44
|:|e|n|d|i|n|t|e|r|f|a|c|e| @61
@@ -12,7 +12,7 @@
1212
|:|t|y|p|e| @69
1313
|:|v+0#af5f00255&|a|r| +0#0000000&@70
1414
@75
15-
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@58
15+
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a|b|s|t|r|a|c|t| @58
1616
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |c|l|a|s@1| @61
1717
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |e|n|d|c|l|a|s@1| @58
1818
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |e|n|d|e|n|u|m| @59

runtime/syntax/vim.vim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: Vim script
33
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
44
" Doug Kearns <dougkearns@gmail.com>
5-
" Last Change: 2024 Dec 30
5+
" Last Change: 2025 Jan 01
66
" Former Maintainer: Charles E. Campbell
77

88
" DO NOT CHANGE DIRECTLY.
@@ -27,12 +27,12 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell
2727

2828
" regular vim commands {{{2
2929
" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR=''
30-
syn keyword vimCommand contained abo[veleft] abs[tract] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue]
31-
syn keyword vimCommand contained conf[irm] cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] ho[rizontal] ij[ump] il[ist] imp[ort]
32-
syn keyword vimCommand contained int[ro] is[earch] isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile]
33-
syn keyword vimCommand contained n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas]
34-
syn keyword vimCommand contained sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal]
35-
syn keyword vimCommand contained tf[irst] tj[ump] tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i
30+
syn keyword vimCommand contained abo[veleft] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm]
31+
syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] ho[rizontal] ij[ump] il[ist] imp[ort] int[ro] is[earch]
32+
syn keyword vimCommand contained isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key]
33+
syn keyword vimCommand contained nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext]
34+
syn keyword vimCommand contained sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump]
35+
syn keyword vimCommand contained tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i
3636

3737
" Lower priority for _new_ to distinguish constructors from the command.
3838
syn match vimCommand contained "\<new\>(\@!"

src/ex_cmds.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ EXCMD(CMD_aboveleft, "aboveleft", ex_wrongmodifier,
129129
EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
130130
ADDR_NONE),
131131
EXCMD(CMD_abstract, "abstract", ex_class,
132-
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
132+
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT,
133133
ADDR_NONE),
134134
EXCMD(CMD_all, "all", ex_all,
135135
EX_BANG|EX_RANGE|EX_COUNT|EX_TRLBAR,
@@ -759,7 +759,7 @@ EXCMD(CMD_intro, "intro", ex_intro,
759759
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
760760
ADDR_NONE),
761761
EXCMD(CMD_interface, "interface", ex_class,
762-
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
762+
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT,
763763
ADDR_NONE),
764764
EXCMD(CMD_isearch, "isearch", ex_findpat,
765765
EX_BANG|EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK,
@@ -1677,7 +1677,7 @@ EXCMD(CMD_tunmap, "tunmap", ex_unmap,
16771677
EX_EXTRA|EX_TRLBAR|EX_NOTRLCOM|EX_CTRLV|EX_CMDWIN|EX_LOCK_OK,
16781678
ADDR_NONE),
16791679
EXCMD(CMD_type, "type", ex_type,
1680-
EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
1680+
EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT,
16811681
ADDR_NONE),
16821682
EXCMD(CMD_undo, "undo", ex_undo,
16831683
EX_RANGE|EX_COUNT|EX_ZEROR|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,

src/testdir/test_vim9_class.vim

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,6 +2386,22 @@ def Test_interface_basics()
23862386
END
23872387
v9.CheckSourceFailure(lines, 'E1345: Not a valid command in an interface: return 5', 6)
23882388

2389+
# Test for "interface" cannot be abbreviated
2390+
lines =<< trim END
2391+
vim9script
2392+
inte Something
2393+
endinterface
2394+
END
2395+
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: inte Something', 2)
2396+
2397+
# Test for "endinterface" cannot be abbreviated
2398+
lines =<< trim END
2399+
vim9script
2400+
interface Something
2401+
endin
2402+
END
2403+
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: endin', 3)
2404+
23892405
# Additional commands after "interface name"
23902406
lines =<< trim END
23912407
vim9script
@@ -3525,6 +3541,14 @@ def Test_abstract_class()
35253541
END
35263542
v9.CheckSourceFailure(lines, 'E1316: Class can only be defined in Vim9 script', 1)
35273543

3544+
# Test for "abstract" cannot be abbreviated
3545+
lines =<< trim END
3546+
vim9script
3547+
abs class A
3548+
endclass
3549+
END
3550+
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: abs class A', 2)
3551+
35283552
# Additional commands after "abstract class"
35293553
lines =<< trim END
35303554
vim9script

src/testdir/test_vim9_typealias.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ def Test_typealias()
4848
END
4949
v9.CheckSourceFailure(lines, 'E1393: Type can only be defined in Vim9 script', 1)
5050

51+
# The complete "type" should be specified
52+
lines =<< trim END
53+
vim9script
54+
typ Index = number
55+
END
56+
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: typ Index = number', 2)
57+
5158
# Use :type without any arguments
5259
lines =<< trim END
5360
vim9script

src/version.c

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

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
985,
707709
/**/
708710
984,
709711
/**/

0 commit comments

Comments
 (0)