forked from aniani/vim
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>
This commit is contained in:
parent
663d18d610
commit
aa979c763d
@ -194,13 +194,34 @@ function s:parse_vim_command(cmd)
|
||||
let item.syn_str = item.name
|
||||
call add(a:cmd, copy(item))
|
||||
|
||||
" ":fina" means ":finally" in legacy script, for backwards compatibility.
|
||||
" (From Vim source code find_ex_command() in ex_docmd.c)
|
||||
let no_shorten_in_vim9 =<< trim EOL
|
||||
final
|
||||
def
|
||||
enddef
|
||||
class
|
||||
endclass
|
||||
enum
|
||||
endenum
|
||||
interface
|
||||
endinterface
|
||||
abstract
|
||||
public
|
||||
static
|
||||
this
|
||||
var
|
||||
type
|
||||
EOL
|
||||
|
||||
call map(a:cmd, {_, v ->
|
||||
\ v.name ==# 'final' ?
|
||||
\ index(no_shorten_in_vim9, v.name) != -1 ?
|
||||
\ extend(copy(v), {'omit_idx': -1, 'syn_str': v.name}) :
|
||||
"\ ":fina" means ":finally" in legacy script, for backwards compatibility.
|
||||
"\ (From Vim source code find_ex_command() in ex_docmd.c)
|
||||
\ v.name ==# 'finally' ?
|
||||
\ extend(copy(v), {'omit_idx': 3, 'syn_str': 'fina[lly]'}) :
|
||||
"\ :ho must not be recognized as :horizontal.
|
||||
\ v.name ==# 'horizontal' ?
|
||||
\ extend(copy(v), {'omit_idx': 2, 'syn_str': 'hor[izontal]'}) :
|
||||
\ v
|
||||
\ })
|
||||
|
||||
@ -233,6 +254,7 @@ function s:get_vim_command_type(cmd_name)
|
||||
Next
|
||||
Print
|
||||
X
|
||||
abstract
|
||||
append
|
||||
augroup
|
||||
augroup
|
||||
@ -715,6 +737,29 @@ function s:check_help_doc(vim_info)
|
||||
i
|
||||
END
|
||||
|
||||
let nocheck_shorten_excmd_list =<< trim END
|
||||
bufdo
|
||||
cfdo
|
||||
cstag
|
||||
debug
|
||||
defer
|
||||
eval
|
||||
intro
|
||||
lfdo
|
||||
luado
|
||||
luafile
|
||||
ownsyntax
|
||||
py3do
|
||||
pydo
|
||||
pyxdo
|
||||
pyxfile
|
||||
rundo
|
||||
smile
|
||||
syntime
|
||||
windo
|
||||
wundo
|
||||
END
|
||||
|
||||
" Check the Ex-command is listed in index.txt
|
||||
split index.txt
|
||||
for vimcmd in a:vim_info.cmd
|
||||
@ -750,8 +795,8 @@ function s:check_help_doc(vim_info)
|
||||
call s:err_sanity($'Help tag for Ex-cmd ":{vimcmd.name}" not found.')
|
||||
elseif len(qfl) > 1
|
||||
call s:err_sanity($'Help tag for Ex-cmd ":{vimcmd.name}" is duplicated.')
|
||||
else
|
||||
" Check the existence of Ex-command notation.
|
||||
elseif index(nocheck_shorten_excmd_list, vimcmd.name) ==# -1
|
||||
" Check the existence of the shorten Ex-command notation.
|
||||
cc
|
||||
norm! 2k
|
||||
let end_lnum = qfl[0].lnum + 10
|
||||
@ -778,7 +823,9 @@ function s:check_help_doc(vim_info)
|
||||
call s:err_gen('')
|
||||
throw 'exit'
|
||||
finally
|
||||
call s:err_gen('Ex-cmd documentation consistency check completed.')
|
||||
exec 'cd ' . cwd_save
|
||||
set wildignore&
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
>:|a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&@63
|
||||
|:|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&@66
|
||||
|:|a+0#af5f00255&|b|o|v|e|l|e|f|t| +0#0000000&@64
|
||||
|:|a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@65
|
||||
|:|a|b|s|t|r|a|c|t| @65
|
||||
|:|a+0#af5f00255&|l@1| +0#0000000&@70
|
||||
|:|a+0#af5f00255&|m|e|n|u| +0#0000000&@68
|
||||
|:|a+0#af5f00255&|n|o|r|e|m|e|n|u| +0#0000000&@64
|
||||
|
@ -13,7 +13,7 @@
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&@56
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&@59
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|o|v|e|l|e|f|t| +0#0000000&@57
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@58
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a|b|s|t|r|a|c|t| @58
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|l@1| +0#0000000&@63
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|m|e|n|u| +0#0000000&@61
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|n|o|r|e|m|e|n|u| +0#0000000&@57
|
||||
|
@ -16,5 +16,5 @@
|
||||
@75
|
||||
|"+0#0000e05&| |V|i|m|9|-|s|c|r|i|p|t| |o|n|l|y| +0#0000000&@56
|
||||
@75
|
||||
|:|a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@65
|
||||
|:|a|b|s|t|r|a|c|t| @65
|
||||
@57|1@1|7|1|,|1| @7|9|7|%|
|
||||
|
@ -1,4 +1,4 @@
|
||||
|:+0&#ffffff0|a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@65
|
||||
|:+0&#ffffff0|a|b|s|t|r|a|c|t| @65
|
||||
|:|c|l|a|s@1| @68
|
||||
|:|e|n|d|c|l|a|s@1| @65
|
||||
|:|e|n|d|i|n|t|e|r|f|a|c|e| @61
|
||||
@ -12,7 +12,7 @@
|
||||
|:|t|y|p|e| @69
|
||||
|:|v+0#af5f00255&|a|r| +0#0000000&@70
|
||||
@75
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a+0#af5f00255&|b|s|t|r|a|c|t| +0#0000000&@58
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |a|b|s|t|r|a|c|t| @58
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |c|l|a|s@1| @61
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |e|n|d|c|l|a|s@1| @58
|
||||
|F|o@1|(+0#e000e06&|)| +0#0000000&||| |e|n|d|e|n|u|m| @59
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2024 Dec 30
|
||||
" Last Change: 2025 Jan 01
|
||||
" Former Maintainer: Charles E. Campbell
|
||||
|
||||
" DO NOT CHANGE DIRECTLY.
|
||||
@ -27,12 +27,12 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR=''
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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
|
||||
|
||||
" Lower priority for _new_ to distinguish constructors from the command.
|
||||
syn match vimCommand contained "\<new\>(\@!"
|
||||
|
@ -129,7 +129,7 @@ EXCMD(CMD_aboveleft, "aboveleft", ex_wrongmodifier,
|
||||
EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_abstract, "abstract", ex_class,
|
||||
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
|
||||
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_all, "all", ex_all,
|
||||
EX_BANG|EX_RANGE|EX_COUNT|EX_TRLBAR,
|
||||
@ -759,7 +759,7 @@ EXCMD(CMD_intro, "intro", ex_intro,
|
||||
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_interface, "interface", ex_class,
|
||||
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
|
||||
EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_isearch, "isearch", ex_findpat,
|
||||
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,
|
||||
EX_EXTRA|EX_TRLBAR|EX_NOTRLCOM|EX_CTRLV|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_type, "type", ex_type,
|
||||
EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
|
||||
EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_WHOLE|EX_EXPORT,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_undo, "undo", ex_undo,
|
||||
EX_RANGE|EX_COUNT|EX_ZEROR|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
|
@ -2386,6 +2386,22 @@ def Test_interface_basics()
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1345: Not a valid command in an interface: return 5', 6)
|
||||
|
||||
# Test for "interface" cannot be abbreviated
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
inte Something
|
||||
endinterface
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: inte Something', 2)
|
||||
|
||||
# Test for "endinterface" cannot be abbreviated
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
interface Something
|
||||
endin
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: endin', 3)
|
||||
|
||||
# Additional commands after "interface name"
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
@ -3525,6 +3541,14 @@ def Test_abstract_class()
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1316: Class can only be defined in Vim9 script', 1)
|
||||
|
||||
# Test for "abstract" cannot be abbreviated
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
abs class A
|
||||
endclass
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: abs class A', 2)
|
||||
|
||||
# Additional commands after "abstract class"
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
|
@ -48,6 +48,13 @@ def Test_typealias()
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1393: Type can only be defined in Vim9 script', 1)
|
||||
|
||||
# The complete "type" should be specified
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
typ Index = number
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: typ Index = number', 2)
|
||||
|
||||
# Use :type without any arguments
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
985,
|
||||
/**/
|
||||
984,
|
||||
/**/
|
||||
|
@ -1738,6 +1738,7 @@ enum_set_internal_obj_vars(class_T *en, object_T *enval)
|
||||
|
||||
/*
|
||||
* Handle ":class" and ":abstract class" up to ":endclass".
|
||||
* Handle ":enum" up to ":endenum".
|
||||
* Handle ":interface" up to ":endinterface".
|
||||
*/
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user