diff options
-rw-r--r-- | runtime/autoload/health/provider.vim | 27 | ||||
-rw-r--r-- | runtime/autoload/remote/host.vim | 8 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 3 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 96 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.c | 6 | ||||
-rw-r--r-- | src/nvim/hardcopy.c | 2 | ||||
-rw-r--r-- | src/nvim/po/eo.po | 5 | ||||
-rw-r--r-- | src/nvim/po/fr.po | 15 | ||||
-rw-r--r-- | src/nvim/screen.c | 14 | ||||
-rw-r--r-- | src/nvim/testdir/Makefile | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_alot.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_matchadd_conceal.vim | 262 | ||||
-rw-r--r-- | src/nvim/testdir/test_matchadd_conceal_utf8.vim | 39 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 12 | ||||
-rw-r--r-- | src/nvim/version.c | 28 | ||||
-rw-r--r-- | test/functional/legacy/match_conceal_spec.lua | 228 | ||||
-rw-r--r-- | test/functional/legacy/undolevels_spec.lua | 6 |
17 files changed, 399 insertions, 355 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 8fa281e7e3..b1cfa8bf2b 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -100,26 +100,31 @@ function! s:version_info(python) abort \ 'import neovim; print(neovim.__file__)', \ '2>/dev/null'])) - let nvim_path = s:trim(system([ - \ 'python3', - \ '-c', - \ 'import neovim; print(neovim.__file__)' - \ ])) - " \ '2>/dev/null'])) - if empty(nvim_path) return [python_version, 'unable to find neovim executable', pypi_version, 'unable to get neovim executable'] endif + " Assuming that multiple versions of a package are installed, sort them + " numerically in descending order. + function! s:compare(metapath1, metapath2) + let a = matchstr(fnamemodify(a:metapath1, ':p:h:t'), '[0-9.]\+') + let b = matchstr(fnamemodify(a:metapath2, ':p:h:t'), '[0-9.]\+') + return a == b ? 0 : a > b ? 1 : -1 + endfunction + let nvim_version = 'unable to find neovim version' let base = fnamemodify(nvim_path, ':h') - for meta in glob(base.'-*/METADATA', 1, 1) + glob(base.'-*/PKG-INFO', 1, 1) - for meta_line in readfile(meta) + let metas = glob(base.'-*/METADATA', 1, 1) + glob(base.'-*/PKG-INFO', 1, 1) + let metas = sort(metas, 's:compare') + + if !empty(metas) + for meta_line in readfile(metas[0]) if meta_line =~# '^Version:' let nvim_version = matchstr(meta_line, '^Version: \zs\S\+') + break endif endfor - endfor + endif let version_status = 'unknown' if !s:is_bad_response(nvim_version) && !s:is_bad_response(pypi_version) @@ -148,7 +153,7 @@ endfunction function! s:check_python(version) abort call health#report_start('Python ' . a:version . ' provider') - let python_bin_name = 'python'.(a:version == 2 ? '2' : '3') + let python_bin_name = 'python'.(a:version == 2 ? '' : '3') let pyenv = resolve(exepath('pyenv')) let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n' let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : '' diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index 110f80297a..d4e8e98bc0 100644 --- a/runtime/autoload/remote/host.vim +++ b/runtime/autoload/remote/host.vim @@ -260,11 +260,9 @@ endfunction function! remote#host#LoadErrorForHost(host, log) abort return 'Failed to load '. a:host . ' host. '. - \ 'You can try to see what happened '. - \ 'by starting Neovim with the environment variable '. - \ a:log . ' set to a file and opening the generated '. - \ 'log file. Also, the host stderr is available '. - \ 'in messages.' + \ 'You can try to see what happened by starting nvim with '. + \ a:log . ' set and opening the generated log file.'. + \ ' Also, the host stderr is available in messages.' endfunction diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index c505652b1b..249208911b 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -36,7 +36,9 @@ these differences. - 'autoindent' is set by default - 'autoread' is set by default - 'backspace' defaults to "indent,eol,start" +- 'backupdir' defaults to .,~/.local/share/nvim/backup (|xdg|) - 'complete' doesn't include "i" +- 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created - 'display' defaults to "lastline" - 'encoding' defaults to "utf-8" - 'formatoptions' defaults to "tcqj" @@ -54,6 +56,7 @@ these differences. - 'tabpagemax' defaults to 50 - 'tags' defaults to "./tags;,tags" - 'ttyfast' is always set +- 'undodir' defaults to ~/.local/share/nvim/undo (|xdg|), auto-created - 'viminfo' includes "!" - 'wildmenu' is set by default diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index c809f700a9..d056e5b7bf 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -17,71 +17,45 @@ set cpo&vim syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell -" regular vim commands {{{2 -syn keyword vimCommand contained a argd argu[ment] bf[irst] brea[k] buf cabc[lear] cc cfdo changes clo[se] cnf comc[lear] cpf[ile] cstag debugg[reedy] deletel dell diffg[et] dif[fupdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpc[lose] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lf lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] nore on[ly] packl perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] rec[over] reg[isters] rightb[elow] ru[ntime] sba[ll] sbp[revious] sci scr[iptnames] setl[ocal] sgi sh[ell] sIe sil[ent] sir sm[ap] sno[magic] sp spellu[ndo] sre[wind] srp star[tinsert] sun[hide] sy ta tabfir[st] tabN[ext] tags th[row] tN tr[ewind] un unl verb[ose] vimgrepa[dd] w winp[os] wqa[ll] xa[ll] xnoremenu -syn keyword vimCommand contained ab argd[elete] as[cii] bl[ast] breaka[dd] bufdo cad[dbuffer] ccl[ose] cf[ile] chd[ir] cmapc[lear] cNf comp[iler] cp[revious] cuna[bbrev] del deletep delm[arks] diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lfdo lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] nos[wapfile] o[pen] packloadall po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] red res[ize] ru rv[iminfo] sbf[irst] sbr[ewind] scI scs sf[ind] sgI si sig sim[alt] sIr sme snoreme spe spellw[rong] srg st startr[eplace] sunme syn tab tabl[ast] tabo[nly] tc[l] tj[ump] tn[ext] try una[bbreviate] unlo[ckvar] ve[rsion] vi[sual] wa[ll] win[size] w[rite] x[it] xprop -syn keyword vimCommand contained abc[lear] argdo au bm[odified] breakd[el] b[uffer] cadde[xpr] cd cfir[st] che[ckpath] cn cnf[ile] con cq[uit] cw[indow] delc[ommand] deletl delp diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] ld[o] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa nu[mber] opt[ions] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] redi[r] ret[ab] rub[y] sal[l] sbl[ast] sb[uffer] scl scscope sfir[st] sgl sI sIg sin sl smenu snoremenu spelld[ump] sp[lit] sri sta[g] stj[ump] sunmenu sync tabc[lose] tabm[ove] tabp[revious] tcld[o] tl[ast] tN[ext] ts[elect] u[ndo] uns[ilent] vert[ical] viu[sage] wh[ile] wn[ext] ws[verb] xmapc[lear] xunme -syn keyword vimCommand contained abo[veleft] arge[dit] bad[d] bn[ext] breakl[ist] buffers caddf[ile] cdo cgetb[uffer] checkt[ime] cN cNf[ile] conf[irm] cr[ewind] d delel deletp dep diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h helpt[ags] iabc[lear] intro k l lan lc[d] le[ft] lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd o ownsyntax pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r red[o] retu[rn] rubyd[o] san[dbox] sbm[odified] sc scp se[t] sg sgn sic sign sIn sla[st] smile so spe[llgood] spr[evious] srI star st[op] sus[pend] syncbind tabd[o] tabN tabr[ewind] tclf[ile] tm to[pleft] tu undoj[oin] up[date] vi vmapc[lear] win wN[ext] wundo xme xunmenu -syn keyword vimCommand contained al[l] argg[lobal] ba[ll] bN[ext] br[ewind] bun[load] cal[l] ce[nter] cgete[xpr] cl cnew[er] col[der] con[tinue] cs de delep delf di diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hi if is[earch] keepa la lan[guage] lch[dir] lefta[bove] lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] ol[dfiles] p ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re redr[aw] rew[ind] rubyf[ile] sa[rgument] sbn[ext] sce scr setf[iletype] sgc sgp sIc sil sip sl[eep] sn[ext] sor[t] spelli[nfo] sr srl start stopi[nsert] sv[iew] syntime tabe[dit] tabnew tabs te[aroff] tm[enu] tp[revious] tu[nmenu] undol[ist] v vie[w] vne[w] winc[md] wp[revious] wv[iminfo] xmenu xwininfo -syn keyword vimCommand contained ar argl[ocal] bd[elete] bo[tright] bro[wse] bw[ipeout] cat[ch] cex[pr] cg[etfile] cla[st] cn[ext] colo[rscheme] cope[n] cscope debug d[elete] delf[unction] dif difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lex[pr] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new nor omapc[lear] pa[ckadd] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q r[ead] redraws[tatus] ri[ght] rundo sav[eas] sbN[ext] scg scripte[ncoding] setg[lobal] sge sgr sie sIl sIp sm[agic] sN[ext] so[urce] spellr[epall] src srn startg[replace] sts[elect] sw[apname] t tabf[ind] tabn[ext] ta[g] tf[irst] tn tr u unh[ide] ve vim[grep] vs[plit] windo wq x xnoreme y[ank] -syn keyword vimCommand contained arga[dd] ar[gs] bel[owright] bp[revious] bu c cb[uffer] cf c[hange] cl[ist] cN[ext] com co[py] -syn match vimCommand contained "\<z[-+^.=]\=\>" -syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns - -" vimOptions are caught only when contained in a vimSet {{{2 -syn keyword vimOption contained acd ambw arshape background ballooneval bg bl brk buftype cf cinkeys cmdwinheight com conceallevel cpoptions cscopetag csto debug dict dir eb emo equalalways eventignore fde fdt fic fillchars fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc paste perldll pm previewwindow printmbfont pythondll redrawtime revins ro ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta taglength tbidi termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan -syn keyword vimOption contained ai anti autochdir backspace balloonexpr bh bo browsedir casemap cfu cino cmp comments confirm cpt cscopetagorder csverb deco dictionary directory ed emoji equalprg ex fdi fen fileencoding fixendofline fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm luadll makeprg maxmem mh mmp more mouses mzq nuw opfunc pastetoggle pex pmbcs printdevice printoptions pythonthreedll regexpengine ri rop rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tagrelative tbis termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write -syn keyword vimOption contained akm antialias autoindent backup bdir bin bomb bs cb ch cinoptions cms commentstring consk crb cscopeverbose cuc def diff display edcompatible enc errorbells expandtab fdl fenc fileencodings fixeol foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchexpr pexpr pmbfn printencoding prompt qe relativenumber rightleft rs runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tags tbs terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany -syn keyword vimOption contained al ar autoread backupcopy bdlay binary breakat bsdir cc charconvert cinw co compatible conskey cryptmethod cspc cul define diffexpr dy ef encoding errorfile exrc fdls fencs fileformat fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa patchmode pfn popt printexpr pt quoteescape remap rightleftcmd rtp sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tagstack tc textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup -syn keyword vimOption contained aleph arab autowrite backupdir belloff biosk breakindent bsk ccv ci cinwords cocu complete copyindent cscopepathcomp csprg cursorbind delcombine diffopt ea efm endofline errorformat fcl fdm fex fileformats fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins ma matchtime mco ml modeline mousefocus mousetime nrformats ofu packpath path ph pp printfont pumheight rdt renderoptions rl ru sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tal tcldll textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay -syn keyword vimOption contained allowrevins arabic autowriteall backupext beval bioskey breakindentopt bt cd cin clipboard cole completefunc cot cscopeprg csqf cursorcolumn dex digraph ead ei eol esckeys fcs fdn ff fileignorecase flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl macatsui maxcombine mef mls modelines mousehide mp nu omnifunc para pdev pheader preserveindent printheader pvh re report rlc rubydll sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tb tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws -syn keyword vimOption contained altkeymap arabicshape aw backupskip bex bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopequickfix csre cursorline dg dip eadirection ek ep et fdc fdo ffs filetype fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paragraphs penc pi previewheight printmbcharset pvw readonly restorescreen rnu ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax tagcase tbi term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww -syn keyword vimOption contained ambiwidth ari awa balloondelay bexpr bkc briopt buflisted cedit cink cmdheight columns concealcursor cpo cscoperelative cst cwh - -" vimOptions: These are the turn-off setting variants {{{2 -syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobreakindent nocf nocindent noconsk nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangnoremap nolbr nolisp nolnr nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup -syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobiosk nobl nobri noci nocompatible noconskey nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolinebreak nolist noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows -syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobioskey nobomb nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois - -" vimOptions: These are the invertible variants {{{2 -syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbreakindent invcf invcindent invconsk invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangnoremap invlbr invlisp invlnr invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup -syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbiosk invbl invbri invci invcompatible invconskey invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlinebreak invlist invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws -syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbioskey invbomb invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis +" Special and plugin vim commands {{{2 +syn match vimCommand contained "\<z[-+^.=]\=" +syn keyword vimOnlyCommand contained fix[del] op[en] sh[ell] P[rint] +syn keyword vimStdPlugin contained DiffOrig Man N[ext] S TOhtml XMLent XMLns +" Vim-specific options {{{2 +syn keyword vimOnlyOption contained biosk bioskey cp compatible consk conskey cm cryptmethod edcompatible guipty key macatsui mzq mzquantum osfiletype oft renderoptions rop st shelltype sn shortname tenc termencoding ta textauto tx textmode tf ttyfast ttym ttymouse tbi ttybuiltin wiv weirdinvert + +" Turn-off setting variants +syn keyword vimOnlyOption contained nobiosk nobioskey noconsk noconskey nocp nocompatible noguipty nomacatsui nosn noshortname nota notextauto notx notextmode notf nottyfast notbi nottybuiltin nowiv noweirdinvert + +" Invertible setting variants +syn keyword vimOnlyOption contained invbiosk invbioskey invconsk invconskey invcp invcompatible invguipty invmacatsui invsn invshortname invta invtextauto invtx invtextmode invtf invttyfast invtbi invttybuiltin invwiv invweirdinvert " termcap codes (which can also be set) {{{2 -syn keyword vimOption contained t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RB t_RI t_RV t_Sb t_se t_Sf t_SI t_so t_sr t_SR t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xn t_xs t_ZH t_ZR -syn keyword vimOption contained t_AF t_AL t_cd t_Ce t_cm t_cs t_CS t_da t_dl -syn match vimOption contained "t_%1" -syn match vimOption contained "t_#2" -syn match vimOption contained "t_#4" -syn match vimOption contained "t_@7" -syn match vimOption contained "t_*7" -syn match vimOption contained "t_&8" -syn match vimOption contained "t_%i" -syn match vimOption contained "t_k;" +syn keyword vimTermOption contained t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CS t_CV t_da t_db t_dl t_DL t_EI t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RI t_RV t_Sb t_se t_Sf t_SI t_so t_sr t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xs t_ZH t_ZR +syn keyword vimTermOption contained t_AF t_AL t_cd t_Ce t_cm t_cs +syn match vimTermOption contained "t_%1" +syn match vimTermOption contained "t_#2" +syn match vimTermOption contained "t_#4" +syn match vimTermOption contained "t_@7" +syn match vimTermOption contained "t_*7" +syn match vimTermOption contained "t_&8" +syn match vimTermOption contained "t_%i" +syn match vimTermOption contained "t_k;" " unsupported settings: these are supported by vi but don't do anything in vim {{{2 syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600 - -" AutoCmd Events {{{2 +"}}}2 syn case ignore -syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave - " Highlight commonly used Groupnames {{{2 syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo " Default highlighting groups {{{2 -syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu +syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual WarningMsg WildMenu syn match vimHLGroup contained "Conceal" +syn keyword vimOnlyHLGroup contained VisualNOS +syn keyword nvimHLGroup contained EndOfBuffer TermCursor TermCursorNC QuickFixLine +"}}}2 syn case match - -" Function Names {{{2 -syn keyword vimFuncName contained abs and arglistid assert_exception assert_true browsedir bufname byteidx changenr ch_evalraw ch_log ch_readraw ch_status complete copy cscope_connection did_filetype empty executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdpos getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy glob2regpat has_key histadd histnr hostname index inputlist inputsecret isdirectory items job_setoptions job_stop js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setline setpos settabvar sha256 simplify sort spellsuggest str2float strdisplaywidth string strridx submatch synID synstack tabpagebuflist tagfiles tanh timer_stop tr undofile values wildmenumode win_findbuf winheight winline winrestview wordcount -syn keyword vimFuncName contained acos append argv assert_fails atan bufexists bufnr byteidxcomp char2nr ch_getbufnr ch_logfile ch_sendexpr cindent complete_add cos cursor diff_filler escape exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcharsearch getcmdtype getcwd getfsize getline getpid getreg gettabwinvar getwinvar globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked job_getchannel job_start join json_decode len line localtime luaeval mapcheck matchaddpos matchend matchstrpos mkdir nextnonblank pathshorten prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strftime strlen strtrans substitute synIDattr system tabpagenr taglist tempname tolower trunc undotree virtcol winbufnr win_getid win_id2tabwin winnr winsaveview writefile -syn keyword vimFuncName contained add argc asin assert_false atan2 buflisted bufwinnr call ch_close ch_getjob ch_open ch_sendraw clearmatches complete_check cosh deepcopy diff_hlID eval exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdline getcmdwintype getfontname getftime getloclist getpos getregtype getwinposx glob has hasmapto histget hlID indent inputdialog inputsave invert isnan job_info job_status js_decode json_encode libcall line2byte log map match matcharg matchlist max mode nr2char perleval printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strchars stridx strpart strwidth synconcealed synIDtrans systemlist tabpagewinnr tan timer_start toupper type uniq visualmode wincol win_gotoid win_id2win winrestcmd winwidth xor -syn keyword vimFuncName contained alloc_fail argidx assert_equal assert_match browse bufloaded byte2line ceil ch_evalexpr ch_info ch_read ch_setoptions col confirm count delete disable_char_avail_for_testing eventhandler - -"--- syntax here and above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 " Set up folding commands @@ -217,7 +191,7 @@ endif " Functions : Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID -syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand +syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand,nvimUnmap,nvimMap syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' @@ -362,7 +336,7 @@ syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbre " Autocmd {{{2 " ======= -syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace +syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent,nvimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList syn match vimAutoCmdSfxList contained "\S*" syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList @@ -371,7 +345,7 @@ syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vim " ================ syn region vimEcho oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimFuncVar,vimString,vimVar syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimFuncVar,vimIsCommand,vimOper,vimNotation,vimOperParen,vimString,vimVar -syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone +syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone,vimOnlyHLGroup,nvimHLGroup syn case ignore syn keyword vimEchoHLNone none syn case match @@ -380,8 +354,10 @@ syn case match " ==== syn match vimMap "\<map\>!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs +syn keyword nvimMap tn[oremap] tm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn keyword vimMap mapc[lear] smapc[lear] syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs +syn keyword nvimUnmap tunm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs syn match vimMapMod contained "\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs @@ -507,7 +483,7 @@ syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup syn match vimSynRegOpt contained "\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>" syn match vimSynReg contained "\(start\|skip\|end\)="he=e-1 nextgroup=vimSynRegPat -syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup +syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup,vimOnlyHLGroup,nvimHLGroup syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=" syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod @@ -584,7 +560,7 @@ syn match vimHiNmbr contained '\d\+' syn keyword vimHiClear contained clear nextgroup=vimHiGroup " Highlight: link {{{2 -syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation +syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation,vimOnlyHLGroup,nvimHLGroup syn cluster vimFuncBodyList add=vimHiLink " Control Characters {{{2 @@ -814,6 +790,7 @@ hi def link vimAuHighlight vimHighlight hi def link vimAutoCmdOpt vimOption hi def link vimAutoCmd vimCommand hi def link vimAutoEvent Type +hi def link nvimAutoEvent vimAutoEvent hi def link vimAutoSet vimCommand hi def link vimBehaveModel vimBehave hi def link vimBehave vimCommand @@ -860,6 +837,7 @@ hi def link vimHiNmbr Number hi def link vimHiStartStop vimHiTerm hi def link vimHiTerm Type hi def link vimHLGroup vimGroup +hi def link nvimHLGroup vimHLGroup hi def link vimHLMod PreProc hi def link vimInsert vimString hi def link vimIskSep Delimiter @@ -871,6 +849,7 @@ hi def link vimMapBang vimCommand hi def link vimMapModKey vimFuncSID hi def link vimMapMod vimBracket hi def link vimMap vimCommand +hi def link nvimMap vimMap hi def link vimMark Number hi def link vimMarkNumber vimNumber hi def link vimMenuMod vimMapMod @@ -939,6 +918,7 @@ hi def link vimSyntax vimCommand hi def link vimSynType vimSpecial hi def link vimTodo Todo hi def link vimUnmap vimMap +hi def link nvimUnmap vimMap hi def link vimUserAttrbCmpltFunc Special hi def link vimUserAttrbCmplt vimSpecial hi def link vimUserAttrbKey vimOption diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index fc114bae16..d80ee7dc67 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -368,11 +368,10 @@ static inline void typval_encode_list_start(EncodedData *const edata, const size_t len) FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_NONNULL_ALL { - const Object obj = OBJECT_INIT; kv_push(edata->stack, ARRAY_OBJ(((Array) { .capacity = len, .size = 0, - .items = xmalloc(len * sizeof(*obj.data.array.items)), + .items = xmalloc(len * sizeof(*((Object *)NULL)->data.array.items)), }))); } @@ -409,11 +408,10 @@ static inline void typval_encode_dict_start(EncodedData *const edata, const size_t len) FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_NONNULL_ALL { - const Object obj = OBJECT_INIT; kv_push(edata->stack, DICTIONARY_OBJ(((Dictionary) { .capacity = len, .size = 0, - .items = xmalloc(len * sizeof(*obj.data.dictionary.items)), + .items = xmalloc(len * sizeof(*((Object *)NULL)->data.dictionary.items)), }))); } diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 7d4bfd0290..6acf7f395a 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -2105,7 +2105,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) props = enc_canon_props(p_encoding); if (!(props & ENC_8BIT) && ((*p_pmcs != NUL) || !(props & ENC_UNICODE))) { p_mbenc_first = NULL; - int effective_cmap; + int effective_cmap = 0; for (cmap = 0; cmap < (int)ARRAY_SIZE(prt_ps_mbfonts); cmap++) if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap], &p_mbenc)) { diff --git a/src/nvim/po/eo.po b/src/nvim/po/eo.po index 6a62da870e..8a3cd50406 100644 --- a/src/nvim/po/eo.po +++ b/src/nvim/po/eo.po @@ -1346,11 +1346,6 @@ msgstr "E670: Miksaĵo de kodoprezento de helpa dosiero en lingvo: %s" msgid "E154: Duplicate tag \"%s\" in file %s/%s" msgstr "E154: Ripetita etikedo \"%s\" en dosiero %s/%s" -#: ../ex_cmds.c:5687 -#, c-format -msgid "E150: Not a directory: %s" -msgstr "E150: Ne estas dosierujo: %s" - #, c-format msgid "E160: Unknown sign command: %s" msgstr "E160: Nekonata simbola komando: %s" diff --git a/src/nvim/po/fr.po b/src/nvim/po/fr.po index 49b7d06dd3..cd9f5a7eb2 100644 --- a/src/nvim/po/fr.po +++ b/src/nvim/po/fr.po @@ -1400,10 +1400,6 @@ msgstr " sur 1 ligne" msgid " on %<PRId64> lines" msgstr " sur %<PRId64> lignes" -#, c-format -msgid "E150: Not a directory: %s" -msgstr "E150: %s n'est pas un r?pertoire" - # AB - Il faut respecter l'esprit plus que la lettre. # AB - Ce message devrait contenir une référence à :vglobal. #: ../ex_cmds.c:4438 @@ -7011,17 +7007,6 @@ msgstr "Non" #~ msgid "Directory\t*.nothing\n" #~ msgstr "Répertoire\t*.rien\n" -#, c-format -msgid "E671: Cannot find window title \"%s\"" -msgstr "E671: Titre de fen?tre \"%s\" introuvable" - -#, c-format -msgid "E243: Argument not supported: \"-%s\"; Use the OLE version." -msgstr "E243: Argument non support? : \"-%s\" ; Utilisez la version OLE." - -msgid "E672: Unable to open window inside MDI application" -msgstr "E672: Impossible d'ouvrir une fen?tre dans une application MDI" - # DB - todo : perfectible. #~ msgid "" #~ "Vim E458: Cannot allocate colormap entry, some colors may be incorrect" diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 9a2eeda8b2..47dd640e59 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2210,8 +2210,8 @@ win_line ( ///< force wrapping int vcol_off = 0; ///< offset for concealed characters int did_wcol = false; - int match_conc = false; ///< cchar for match functions - int has_match_conc = false; ///< match wants to conceal + int match_conc = 0; ///< cchar for match functions + int has_match_conc = 0; ///< match wants to conceal int old_boguscols = 0; # define VCOL_HLC (vcol - vcol_off) # define FIX_FOR_BOGUSCOLS \ @@ -2656,7 +2656,7 @@ win_line ( // Repeat for the whole displayed line. for (;; ) { - has_match_conc = false; + has_match_conc = 0; // Skip this quickly when working on the text. if (draw_state != WL_LINE) { if (draw_state == WL_CMDLINE - 1 && n_extra == 0) { @@ -2906,10 +2906,10 @@ win_line ( shl->attr_cur = shl->attr; if (cur != NULL && syn_name2id((char_u *)"Conceal") == cur->hlg_id) { - has_match_conc = true; + has_match_conc = v == (long)shl->startcol ? 2 : 1; match_conc = cur->conceal_char; } else { - has_match_conc = match_conc = false; + has_match_conc = match_conc = 0; } } else if (v == (long)shl->endcol) { shl->attr_cur = 0; @@ -3633,11 +3633,11 @@ win_line ( if (wp->w_p_cole > 0 && (wp != curwin || lnum != wp->w_cursor.lnum || conceal_cursor_line(wp)) - && ((syntax_flags & HL_CONCEAL) != 0 || has_match_conc) + && ((syntax_flags & HL_CONCEAL) != 0 || has_match_conc > 0) && !(lnum_in_visual_area && vim_strchr(wp->w_p_cocu, 'v') == NULL)) { char_attr = conceal_attr; - if (prev_syntax_id != syntax_seqnr + if ((prev_syntax_id != syntax_seqnr || has_match_conc > 1) && (syn_get_sub_char() != NUL || match_conc || wp->w_p_cole == 1) && wp->w_p_cole != 3) { diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 10d26bd8cf..4d21887240 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -41,6 +41,7 @@ NEW_TESTS = \ test_viml.res \ test_visual.res \ test_window_id.res \ + test_matchadd_conceal.res \ test_alot.res SCRIPTS_GUI := test16.out diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index f0efd6e4ed..7169b6076f 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -3,6 +3,7 @@ source test_assign.vim source test_cursor_func.vim +source test_ex_undo.vim source test_feedkeys.vim source test_cmdline.vim source test_menu.vim @@ -10,3 +11,4 @@ source test_popup.vim source test_regexp_utf8.vim source test_syn_attr.vim source test_unlet.vim +source test_matchadd_conceal_utf8.vim diff --git a/src/nvim/testdir/test_matchadd_conceal.vim b/src/nvim/testdir/test_matchadd_conceal.vim new file mode 100644 index 0000000000..bc1c28d6e9 --- /dev/null +++ b/src/nvim/testdir/test_matchadd_conceal.vim @@ -0,0 +1,262 @@ +" Test for matchadd() and conceal feature +if !has('conceal') + finish +endif + +function! s:screenline(lnum) abort + let line = [] + for c in range(1, winwidth(0)) + call add(line, nr2char(screenchar(a:lnum, c))) + endfor + return s:trim(join(line, '')) +endfunction + +function! s:trim(str) abort + return matchstr(a:str,'^\s*\zs.\{-}\ze\s*$') +endfunction + +function! Test_simple_matchadd() + new + + 1put='# This is a Test' + " 1234567890123456 + let expect = '# This is a Test' + + call cursor(1, 1) + call matchadd('Conceal', '\%2l ') + redraw! + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + quit! +endfunction + +function! Test_simple_matchadd_and_conceal() + new + setlocal concealcursor=n conceallevel=1 + + 1put='# This is a Test' + " 1234567890123456 + let expect = '#XThisXisXaXTest' + + call cursor(1, 1) + call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'X'}) + redraw! + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + quit! +endfunction + +function! Test_matchadd_and_conceallevel_3() + new + + setlocal conceallevel=3 + " set filetype and :syntax on to change screenattr() + setlocal filetype=conf + syntax on + + 1put='# This is a Test' + " 1234567890123456 + let expect = '#ThisisaTest' + + call cursor(1, 1) + call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'X'}) + redraw! + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 16)) + + " more matchadd() + " 1234567890123456 + let expect = '#Thisisa Test' + + call matchadd('ErrorMsg', '\%2l Test', 20, -1, {'conceal': 'X'}) + redraw! + call assert_equal(expect, s:screenline(lnum)) + call assert_equal(screenattr(lnum, 1) , screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2) , screenattr(lnum, 7)) + call assert_notequal(screenattr(lnum, 1) , screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 10), screenattr(lnum, 12)) + call assert_notequal(screenattr(lnum, 1) , screenattr(lnum, 16)) + call assert_notequal(screenattr(lnum, 10), screenattr(lnum, 16)) + + syntax off + quit! +endfunction + +function! Test_default_conceal_char() + new + setlocal concealcursor=n conceallevel=1 + + 1put='# This is a Test' + " 1234567890123456 + let expect = '# This is a Test' + + call cursor(1, 1) + call matchadd('Conceal', '\%2l ', 10, -1, {}) + redraw! + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + " 1234567890123456 + let expect = '#+This+is+a+Test' + let listchars_save = &listchars + set listchars=conceal:+ + redraw! + + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + let &listchars = listchars_save + quit! +endfunction + +function! Test_syn_and_match_conceal() + new + setlocal concealcursor=n conceallevel=1 + + 1put='# This is a Test' + " 1234567890123456 + let expect = '#ZThisZisZaZTest' + + call cursor(1, 1) + call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'Z'}) + syntax match MyConceal /\%2l / conceal containedin=ALL cchar=* + redraw! + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + " 1234567890123456 + let expect = '#*This*is*a*Test' + call clearmatches() + redraw! + + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + syntax off + quit! +endfunction + +function! Test_clearmatches() + new + setlocal concealcursor=n conceallevel=1 + + 1put='# This is a Test' + " 1234567890123456 + let expect = '# This is a Test' + + call cursor(1, 1) + call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'Z'}) + let a = getmatches() + call clearmatches() + redraw! + + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + " reset match using setmatches() + " 1234567890123456 + let expect = '#ZThisZisZaZTest' + call setmatches(a) + redraw! + + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + call assert_equal({'group': 'Conceal', 'pattern': '\%2l ', 'priority': 10, 'id': a[0].id, 'conceal': 'Z'}, a[0]) + + quit! +endfunction + +function! Test_using_matchaddpos() + new + setlocal concealcursor=n conceallevel=1 + " set filetype and :syntax on to change screenattr() + setlocal filetype=conf + syntax on + + 1put='# This is a Test' + " 1234567890123456 + let expect = '#Pis a Test' + + call cursor(1, 1) + call matchaddpos('Conceal', [[2,2,6]], 10, -1, {'conceal': 'P'}) + let a = getmatches() + redraw! + + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1) , screenattr(lnum, 2)) + call assert_notequal(screenattr(lnum, 2) , screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 1) , screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 1) , screenattr(lnum, 10)) + call assert_notequal(screenattr(lnum, 1) , screenattr(lnum, 12)) + call assert_notequal(screenattr(lnum, 1) , screenattr(lnum, 16)) + call assert_equal(screenattr(lnum, 12), screenattr(lnum, 16)) + call assert_equal({'group': 'Conceal', 'id': a[0].id, 'priority': 10, 'pos1': [2, 2, 6], 'conceal': 'P'}, a[0]) + + syntax off + quit! +endfunction + +function! Test_matchadd_repeat_conceal_with_syntax_off() + new + + " To test targets in the same line string is replaced with conceal char + " correctly, repeat 'TARGET' + 1put ='TARGET_TARGETTARGET' + call cursor(1, 1) + redraw + call assert_equal('TARGET_TARGETTARGET', s:screenline(2)) + + setlocal conceallevel=2 + call matchadd('Conceal', 'TARGET', 10, -1, {'conceal': 't'}) + + redraw + call assert_equal('t_tt', s:screenline(2)) + + quit! +endfunction diff --git a/src/nvim/testdir/test_matchadd_conceal_utf8.vim b/src/nvim/testdir/test_matchadd_conceal_utf8.vim new file mode 100644 index 0000000000..24c848a99c --- /dev/null +++ b/src/nvim/testdir/test_matchadd_conceal_utf8.vim @@ -0,0 +1,39 @@ +" Test for matchadd() and conceal feature using utf-8. +if !has('conceal') || !has('multi_byte') + finish +endif + +function! s:screenline(lnum) abort + let line = [] + for c in range(1, winwidth(0)) + call add(line, nr2char(screenchar(a:lnum, c))) + endfor + return s:trim(join(line, '')) +endfunction + +function! s:trim(str) abort + return matchstr(a:str,'^\s*\zs.\{-}\ze\s*$') +endfunction + +function! Test_match_using_multibyte_conceal_char() + new + setlocal concealcursor=n conceallevel=1 + + 1put='# This is a Test' + " 1234567890123456 + let expect = '#Ë‘ThisË‘isË‘aË‘Test' + + call cursor(1, 1) + call matchadd('Conceal', '\%2l ', 20, -1, {'conceal': "\u02d1"}) + redraw! + + let lnum = 2 + call assert_equal(expect, s:screenline(lnum)) + call assert_notequal(screenattr(lnum, 1), screenattr(lnum, 2)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 7)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 10)) + call assert_equal(screenattr(lnum, 2), screenattr(lnum, 12)) + call assert_equal(screenattr(lnum, 1), screenattr(lnum, 16)) + + quit! +endfunction diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 04b5868d2c..f03d8b87fa 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -174,7 +174,7 @@ static void terminfo_stop(UI *ui) unibi_out(ui, data->unibi_ext.disable_bracketed_paste); // Disable focus reporting unibi_out(ui, data->unibi_ext.disable_focus_reporting); - flush_buf(ui); + flush_buf(ui, true); uv_tty_reset_mode(); uv_close((uv_handle_t *)&data->output_handle, NULL); uv_run(&data->write_loop, UV_RUN_DEFAULT); @@ -601,7 +601,7 @@ static void tui_flush(UI *ui) unibi_goto(ui, grid->row, grid->col); - flush_buf(ui); + flush_buf(ui, true); } static void suspend_event(void **argv) @@ -774,7 +774,7 @@ static void out(void *ctx, const char *str, size_t len) size_t available = data->bufsize - data->bufpos; if (len > available) { - flush_buf(ui); + flush_buf(ui, false); } memcpy(data->buf + data->bufpos, str, len); @@ -910,13 +910,13 @@ end: unibi_set_if_empty(ut, unibi_clr_eos, "\x1b[J"); } -static void flush_buf(UI *ui) +static void flush_buf(UI *ui, bool toggle_cursor) { uv_write_t req; uv_buf_t buf; TUIData *data = ui->data; - if (!data->busy) { + if (toggle_cursor && !data->busy) { // not busy and the cursor is invisible(see below). Append a "cursor // normal" command to the end of the buffer. data->bufsize += CNORM_COMMAND_MAX_SIZE; @@ -930,7 +930,7 @@ static void flush_buf(UI *ui) uv_run(&data->write_loop, UV_RUN_DEFAULT); data->bufpos = 0; - if (!data->busy) { + if (toggle_cursor && !data->busy) { // not busy and cursor is visible(see above), append a "cursor invisible" // command to the beginning of the buffer for the next flush unibi_out(ui, unibi_cursor_invisible); diff --git a/src/nvim/version.c b/src/nvim/version.c index 302e78cb6c..bdffa21f46 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -122,7 +122,7 @@ static int included_patches[] = { // 2322, // 2321, // 2320, - // 2319, + // 2319 NA // 2318, // 2317, // 2316 NA @@ -163,7 +163,7 @@ static int included_patches[] = { // 2281 NA // 2280, // 2279, - // 2278, + // 2278 NA // 2277, // 2276, // 2275, @@ -209,7 +209,7 @@ static int included_patches[] = { // 2235, // 2234 NA // 2233, - // 2232, + // 2232 NA // 2231, // 2230, // 2229, @@ -326,7 +326,7 @@ static int included_patches[] = { // 2118 NA // 2117, // 2116 NA - // 2115, + // 2115 NA // 2114 NA // 2113, 2112, @@ -496,7 +496,7 @@ static int included_patches[] = { // 1948, // 1947 NA // 1946 NA - // 1945, + // 1945 NA // 1944 NA // 1943 NA // 1942 NA @@ -630,14 +630,14 @@ static int included_patches[] = { // 1814 NA // 1813, // 1812, - // 1811, + // 1811 NA // 1810 NA 1809, 1808, // 1807 NA 1806, - // 1805, - // 1804, + // 1805 NA + // 1804 NA // 1803 NA // 1802, // 1801 NA @@ -647,7 +647,7 @@ static int included_patches[] = { // 1797 NA // 1796 NA // 1795 NA - // 1794, + // 1794 NA // 1793, // 1792 NA // 1791 NA @@ -672,14 +672,14 @@ static int included_patches[] = { // 1773 NA // 1772 NA // 1771 NA - // 1770, + // 1770 NA // 1769, // 1768, // 1767 NA // 1766 NA // 1765, // 1764 NA - // 1763, + 1763, // 1762, // 1761, // 1760 NA @@ -693,7 +693,7 @@ static int included_patches[] = { // 1753, // 1752, // 1751, - // 1750, + // 1750 NA // 1749 NA // 1748, // 1747 NA @@ -703,7 +703,7 @@ static int included_patches[] = { // 1743 NA // 1742, // 1741, - // 1740, + 1740, // 1739, // 1738, // 1737 NA @@ -790,7 +790,7 @@ static int included_patches[] = { // 1656, // 1655 NA 1654, - // 1653, + // 1653 NA 1652, // 1651 NA // 1650, diff --git a/test/functional/legacy/match_conceal_spec.lua b/test/functional/legacy/match_conceal_spec.lua deleted file mode 100644 index d95b07d695..0000000000 --- a/test/functional/legacy/match_conceal_spec.lua +++ /dev/null @@ -1,228 +0,0 @@ --- Test for matchadd() and conceal feature - -local helpers = require('test.functional.helpers')(after_each) -local clear = helpers.clear -local expect = helpers.expect -local source = helpers.source - -describe('match_conceal', function() - before_each(function() - clear() - - source([[ - set wildchar=^E - 10new - vsp - vert resize 20 - put =\"\#\ This\ is\ a\ Test\" - norm! mazt - - fu! ScreenChar(width, lines) - let c='' - for j in range(1,a:lines) - for i in range(1,a:width) - let c.=nr2char(screenchar(j, i)) - endfor - let c.="\n" - endfor - return c - endfu - - fu! ScreenAttr(line, pos, eval) - let g:attr=[] - for col in a:pos - call add(g:attr, screenattr(a:line,col)) - endfor - " In case all values are zero, probably the terminal - " isn't set correctly, so catch that case - let null = (eval(join(g:attr, '+')) == 0) - let str=substitute(a:eval, '\d\+', 'g:attr[&]', 'g') - if null || eval(str) - let g:attr_test="OK: ". str - else - let g:attr_test="FAILED: ".str - let g:attr_test.="\n". join(g:attr, ' ') - let g:attr_test.="\n TERM: ". &term - endif - endfu - - fu! DoRecordScreen() - wincmd l - $put =printf(\"\n%s\", g:test) - $put =g:line - $put =g:attr_test - wincmd p - endfu - ]]) - end) - - it('is working', function() - source([=[ - let g:test ="Test 1: simple addmatch()" - call matchadd('Conceal', '\%2l ') - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - - let g:test ="Test 2: simple addmatch() and conceal (should be: #XThisXisXaXTest)" - norm! 'azt - call clearmatches() - syntax on - set concealcursor=n conceallevel=1 - call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'X'}) - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - - let g:test ="Test 3: addmatch() and conceallevel=3 (should be: #ThisisaTest)" - norm! 'azt - set conceallevel=3 - call clearmatches() - call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'X'}) - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0==1 && 1==2 && 1==3 && 1==4 && 0!=5") - call DoRecordScreen() - - let g:test ="Test 4: more match() (should be: #Thisisa Test)" - norm! 'azt - call matchadd('ErrorMsg', '\%2l Test', 20, -1, {'conceal': 'X'}) - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0==1 && 1==2 && 0!=3 && 3==4 && 0!=5 && 3!=5") - call DoRecordScreen() - - let g:test ="Test 5/1: default conceal char (should be: # This is a Test)" - norm! 'azt - call clearmatches() - set conceallevel=1 - call matchadd('Conceal', '\%2l ', 10, -1, {}) - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - let g:test ="Test 5/2: default conceal char (should be: #+This+is+a+Test)" - norm! 'azt - set listchars=conceal:+ - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - set listchars&vi - - let g:test ="Test 6/1: syn and match conceal (should be: #ZThisZisZaZTest)" - norm! 'azt - call clearmatches() - set conceallevel=1 - call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'Z'}) - syn match MyConceal /\%2l / conceal containedin=ALL cchar=* - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - let g:test ="Test 6/2: syn and match conceal (should be: #*This*is*a*Test)" - norm! 'azt - call clearmatches() - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - - let g:test ="Test 7/1: clear matches" - norm! 'azt - syn on - call matchadd('Conceal', '\%2l ', 10, -1, {'conceal': 'Z'}) - let a=getmatches() - call clearmatches() - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0==1 && 0==2 && 0==3 && 0==4 && 0==5") - call DoRecordScreen() - $put =a - call setmatches(a) - norm! 'azt - let g:test ="Test 7/2: reset match using setmatches()" - norm! 'azt - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - - let g:test ="Test 8: using matchaddpos() (should be #Pis a Test" - norm! 'azt - call clearmatches() - call matchaddpos('Conceal', [[2,2,6]], 10, -1, {'conceal': 'P'}) - let a=getmatches() - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1!=2 && 0==2 && 0==3 && 0!=4 && 0!=5 && 4==5") - call DoRecordScreen() - $put =a - - let g:test ="Test 9: match using multibyte conceal char (should be: #Ë‘ThisË‘isË‘aË‘Test)" - norm! 'azt - call clearmatches() - call matchadd('Conceal', '\%2l ', 20, -1, {'conceal': "\u02d1"}) - redraw! - let line=ScreenChar(winwidth(0),1) - call ScreenAttr(1,[1,2,7,10,12,16], "0!=1 && 1==2 && 1==3 && 1==4 && 0==5") - call DoRecordScreen() - ]=]) - - expect([=[ - - # This is a Test - - Test 1: simple addmatch() - # This is a Test - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5] - - Test 2: simple addmatch() and conceal (should be: #XThisXisXaXTest) - #XThisXisXaXTest - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5] - - Test 3: addmatch() and conceallevel=3 (should be: #ThisisaTest) - #ThisisaTest - OK: g:attr[0]==g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]!=g:attr[5] - - Test 4: more match() (should be: #Thisisa Test) - #Thisisa Test - OK: g:attr[0]==g:attr[1] && g:attr[1]==g:attr[2] && g:attr[0]!=g:attr[3] && g:attr[3]==g:attr[4] && g:attr[0]!=g:attr[5] && g:attr[3]!=g:attr[5] - - Test 5/1: default conceal char (should be: # This is a Test) - # This is a Test - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5] - - Test 5/2: default conceal char (should be: #+This+is+a+Test) - #+This+is+a+Test - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5] - - Test 6/1: syn and match conceal (should be: #ZThisZisZaZTest) - #ZThisZisZaZTest - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5] - - Test 6/2: syn and match conceal (should be: #*This*is*a*Test) - #*This*is*a*Test - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5] - - Test 7/1: clear matches - # This is a Test - OK: g:attr[0]==g:attr[1] && g:attr[0]==g:attr[2] && g:attr[0]==g:attr[3] && g:attr[0]==g:attr[4] && g:attr[0]==g:attr[5] - {'group': 'Conceal', 'pattern': '\%2l ', 'priority': 10, 'id': 10, 'conceal': 'Z'} - - Test 7/2: reset match using setmatches() - #ZThisZisZaZTest - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5] - - Test 8: using matchaddpos() (should be #Pis a Test - #Pis a Test - OK: g:attr[0]!=g:attr[1] && g:attr[1]!=g:attr[2] && g:attr[0]==g:attr[2] && g:attr[0]==g:attr[3] && g:attr[0]!=g:attr[4] && g:attr[0]!=g:attr[5] && g:attr[4]==g:attr[5] - {'group': 'Conceal', 'id': 11, 'priority': 10, 'pos1': [2, 2, 6], 'conceal': 'P'} - - Test 9: match using multibyte conceal char (should be: #Ë‘ThisË‘isË‘aË‘Test) - #Ë‘ThisË‘isË‘aË‘Test - OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]]=]) - end) -end) diff --git a/test/functional/legacy/undolevels_spec.lua b/test/functional/legacy/undolevels_spec.lua index 9902b101f6..1dfc4c17ba 100644 --- a/test/functional/legacy/undolevels_spec.lua +++ b/test/functional/legacy/undolevels_spec.lua @@ -10,7 +10,7 @@ describe('undolevel', function() func FillBuffer() for i in range(1,13) put=i - " Set 'undolevels' to split undo. + " Set 'undolevels' to split undo. exe "setg ul=" . &g:ul endfor endfunc @@ -48,6 +48,10 @@ describe('undolevel', function() call assert_equal(50, &g:undolevels) call assert_equal(-123456, &l:undolevels) + " Drop created windows + set ul& + new + only! endfunc call Test_global_local_undolevels() |