diff --git a/Filelist b/Filelist index f488839740..59415d3d23 100644 --- a/Filelist +++ b/Filelist @@ -273,6 +273,22 @@ SRC_ALL = \ src/libvterm/t/92lp1640917.test \ src/libvterm/t/harness.c \ src/libvterm/t/run-test.pl \ + src/xdiff/COPYING \ + src/xdiff/README.txt \ + src/xdiff/xdiff.h \ + src/xdiff/xdiffi.c \ + src/xdiff/xdiffi.h \ + src/xdiff/xemit.c \ + src/xdiff/xemit.h \ + src/xdiff/xhistogram.c \ + src/xdiff/xinclude.h \ + src/xdiff/xmacros.h \ + src/xdiff/xpatience.c \ + src/xdiff/xprepare.c \ + src/xdiff/xprepare.h \ + src/xdiff/xtypes.h \ + src/xdiff/xutils.c \ + src/xdiff/xutils.h \ # source files for Unix only diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index d92fe1b180..dc670dbd14 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -153,15 +153,14 @@ fun! tar#Browse(tarfile) let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif - let gzip_command = s:get_gzip_command(tarfile) - let curlast= line("$") if tarfile =~# '\.\(gz\|tgz\)$' + let gzip_command = s:get_gzip_command(tarfile) " call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.lrp' " call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "sil! r! cat -- ".shellescape(tarfile,1)."|" . gzip_command . " -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.\(bz2\|tbz\|tb2\)$' " call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " @@ -291,17 +290,16 @@ fun! tar#Read(fname,mode) let tar_secure= " " endif - let gzip_command = s:get_gzip_command(tarfile) - if tarfile =~# '\.bz2$' " call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.\(gz\|tgz\)$' + let gzip_command = s:get_gzip_command(tarfile) " call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1)) exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lrp$' " call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) - exe "sil! r! cat -- ".shellescape(tarfile,1)." | " . gzip_command . " -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lzma$' " call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp @@ -589,8 +587,9 @@ fun! tar#Vimuntar(...) " if necessary, decompress the tarball; then, extract it if tartail =~ '\.tgz' - if executable("bzip2") - silent exe "!bzip2 -d ".shellescape(tartail) + let gzip_command = s:get_gzip_command(tarfile) + if executable(gzip_command) + silent exe "!" . gzip_command . " -d ".shellescape(tartail) elseif executable("gunzip") silent exe "!gunzip ".shellescape(tartail) elseif executable("gzip") @@ -630,11 +629,24 @@ fun! tar#Vimuntar(...) endfun func s:get_gzip_command(file) - if a:file =~# 'z$' && executable('bzip2') - " Some .tgz files are actually compressed with bzip2. Since bzip2 can - " handle the format from gzip, use it if the command exists. + " Try using the "file" command to get the actual compression type, since + " there is no standard way for the naming: ".tgz", ".tbz", ".txz", etc. + " If the "file" command doesn't work fall back to just using the file name. + if a:file =~# 'z$' + let filetype = system('file ' . a:file) + if filetype =~ 'bzip2 compressed' && executable('bzip2') + return 'bzip2' + endif + if filetype =~ 'XZ compressed' && executable('xz') + return 'xz' + endif + endif + if a:file =~# 'bz2$' return 'bzip2' endif + if a:file =~# 'xz$' + return 'xz' + endif return 'gzip' endfunc diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index df18ec6c45..3b2dd32060 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -832,11 +832,12 @@ it, no matter how many backslashes. \\# \# Also see |`=|. - *:* *:* *:* ** - *:* ** *:* ** - *:* ** *:* ** - *:* ** - ** *E495* *E496* *E497* *E499* *E500* + *:* ** *:* ** + *:* ** *:* ** + *:* ** *:* ** + *:* ** + *:* ** *:* ** + *:* ** *E499* *E500* Note: these are typed literally, they are not special keys! is replaced with the word under the cursor (like |star|) is replaced with the WORD under the cursor (see |WORD|) @@ -849,15 +850,16 @@ Note: these are typed literally, they are not special keys! |gf| uses) When executing autocommands, is replaced with the file name of the buffer being manipulated, or the file for a read or - write. + write. *E495* When executing autocommands, is replaced with the currently effective buffer number (for ":r file" and ":so file" it is the current buffer, the file being read/sourced is not in a - buffer). + buffer). *E496* When executing autocommands, is replaced with the match for - which this autocommand was executed. It differs from - only when the file name isn't used to match with - (for FileType, Syntax and SpellFileMissing events). + which this autocommand was executed. *E497* + It differs from only when the file name isn't used + to match with (for FileType, Syntax and SpellFileMissing + events). When executing a ":source" command, is replaced with the file name of the sourced file. *E498* When executing a function, is replaced with: @@ -867,9 +869,12 @@ Note: these are typed literally, they are not special keys! Note that filename-modifiers are useless when is used inside a function. When executing a ":source" command, is replaced with the - line number. *E842* + line number. *E842* When executing a function it's the line number relative to the start of the function. + When executing a script, is replaced with the line number. + It differs from in that is replaced with + the script line number in any situation. *E961* *filename-modifiers* *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs* *::S* diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index d56aea72ad..6670f45c64 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -39,7 +39,9 @@ The second and following arguments may also be a directory name. Vim will then append the file name of the first argument to the directory name to find the file. -This only works when a standard "diff" command is available. See 'diffexpr'. +By default an internal diff library will be used. When 'diffopt' or +'diffexpr' has been set an external "diff" command will be used. This only +works when such a diff program is available. Diffs are local to the current tab page |tab-page|. You can't see diffs with a window in another tab page. This does make it possible to have several @@ -344,8 +346,9 @@ between file1 and file2: > The ">" is replaced with the value of 'shellredir'. -The output of "diff" must be a normal "ed" style diff. Do NOT use a context -diff. This example explains the format that Vim expects: > +The output of "diff" must be a normal "ed" style diff or a unified diff. Do +NOT use a context diff. This example explains the format that Vim expects for +the "ed" style diff: > 1a2 > bbb diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 860a78273b..178edd7c2f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3798,7 +3798,10 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* autocmd buffer number (as a String!) autocmd matched name sourced script file or function name - sourced script file line number + sourced script line number or function + line number + script file line number, also when in + a function word under the cursor WORD under the cursor the {clientid} of the last received @@ -5931,6 +5934,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* (|mapmode-ic|) "sid" The script local ID, used for mappings (||). + "lnum" The line number in "sid", zero if unknown. "nowait" Do not wait for other, longer mappings. (|:map-|). @@ -5978,11 +5982,14 @@ match({expr}, {pat} [, {start} [, {count}]]) *match()* When {expr} is a |List| then this returns the index of the first item where {pat} matches. Each item is used as a String, |Lists| and |Dictionaries| are used as echoed. + Otherwise, {expr} is used as a String. The result is a Number, which gives the index (byte offset) in {expr} where {pat} matches. + A match at the first character or |List| item returns zero. If there is no match -1 is returned. + For getting submatches see |matchlist()|. Example: > :echo match("testing", "ing") " results in 4 @@ -8386,7 +8393,9 @@ term_dumpwrite({buf}, {filename} [, {options}]) Dump the contents of the terminal screen of {buf} in the file {filename}. This uses a format that can be used with |term_dumpload()| and |term_dumpdiff()|. - If {filename} already exists an error is given. *E953* + If the job in the terminal already finished an error is given: + *E958* + If {filename} already exists an error is given: *E953* Also see |terminal-diff|. {options} is a dictionary with these optional entries: diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 031af418f5..16c85d9307 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -851,7 +851,7 @@ A jump table for the options with a short description can be found at |Q_op|. '{A-Z0-9}, or `{A-Z0-9} command takes one to another file. Note that for some commands the 'autowrite' option is not used, see 'autowriteall' for that. - Some buffers will not be written, specifically when 'buttype' is + Some buffers will not be written, specifically when 'buftype' is "nowrite", "nofile", "terminal" or "prompt". *'autowriteall'* *'awa'* *'noautowriteall'* *'noawa'* @@ -2632,13 +2632,13 @@ A jump table for the options with a short description can be found at |Q_op|. {not in Vi} {not available when compiled without the |+diff| feature} - Expression which is evaluated to obtain an ed-style diff file from two - versions of a file. See |diff-diffexpr|. + Expression which is evaluated to obtain a diff file (either ed-style + or unified-style) from two versions of a file. See |diff-diffexpr|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'dip'* *'diffopt'* -'diffopt' 'dip' string (default "filler") +'diffopt' 'dip' string (default "internal,filler") global {not in Vi} {not available when compiled without the |+diff| @@ -2680,11 +2680,31 @@ A jump table for the options with a short description can be found at |Q_op|. foldcolumn:{n} Set the 'foldcolumn' option to {n} when starting diff mode. Without this 2 is used. - Examples: > + internal Use the internal diff library. This is + ignored when 'diffexpr' is set. *E960* + When running out of memory when writing a + buffer this item will be ignored for diffs + involving that buffer. Set the 'verbose' + option to see when this happens. - :set diffopt=filler,context:4 + indent-heuristic + Use the indent heuristic for the internal + diff library. + + algorithm:{text} Use the specified diff algorithm with the + internal diff engine. Currently supported + algorithms are: + myers the default algorithm + minimal spend extra time to generate the + smallest possible diff + patience patience diff algorithm + histogram histogram diff algorithm + + Examples: > + :set diffopt=internal,filler,context:4 :set diffopt= - :set diffopt=filler,foldcolumn:3 + :set diffopt=internal,filler,foldcolumn:3 + :set diffopt-=internal " do NOT use the internal diff parser < *'digraph'* *'dg'* *'nodigraph'* *'nodg'* 'digraph' 'dg' boolean (default off) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index a8b50aaff2..078f72f68f 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -3211,6 +3211,12 @@ by syntax/tex.vim. Please consider uploading any extensions that you write, which typically would go in $HOME/after/syntax/tex/[pkgname].vim, to http://vim.sf.net/. +I've included some support for various popular packages on my website: > + + http://www.drchip.org/astronaut/vim/index.html#LATEXPKGS +< +The syntax files there go into your .../after/syntax/tex/ directory. + *tex-error* *g:tex_no_error* Tex: Excessive Error Highlighting? ~ diff --git a/runtime/doc/tags b/runtime/doc/tags index b6b9452482..91fe7dfeed 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4680,6 +4680,7 @@ E954 options.txt /*E954* E955 eval.txt /*E955* E956 pattern.txt /*E956* E957 eval.txt /*E957* +E958 eval.txt /*E958* E96 diff.txt /*E96* E97 diff.txt /*E97* E98 diff.txt /*E98* @@ -5520,6 +5521,7 @@ channel-drop channel.txt /*channel-drop* channel-functions usr_41.txt /*channel-functions* channel-mode channel.txt /*channel-mode* channel-more channel.txt /*channel-more* +channel-noblock channel.txt /*channel-noblock* channel-open channel.txt /*channel-open* channel-open-options channel.txt /*channel-open-options* channel-raw channel.txt /*channel-raw* @@ -7247,6 +7249,7 @@ job-err_io channel.txt /*job-err_io* job-exit_cb channel.txt /*job-exit_cb* job-functions usr_41.txt /*job-functions* job-in_io channel.txt /*job-in_io* +job-noblock channel.txt /*job-noblock* job-options channel.txt /*job-options* job-out_cb channel.txt /*job-out_cb* job-out_io channel.txt /*job-out_io* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index b954715b8a..abc3d94fb4 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -617,7 +617,18 @@ This will open a window consisting of three parts: 3. The contents of the second dump You can usually see what differs in the second part. Use the 'ruler' to -relate it to the position in the first or second dump. +relate it to the position in the first or second dump. Letters indicate the +kind of difference: + X different character + > cursor in first but not in second + < cursor in second but not in first + w character width differs (single vs double width) + f foreground color differs + b background color differs + a attribute differs (bold, underline, reverse, etc.) + ? character missing in both + + character missing in first + - character missing in second Alternatively, press "s" to swap the first and second dump. Do this several times so that you can spot the difference in the context of the text. diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 38773e02a2..964b154e5f 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -38,8 +38,10 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- +tar plugin: use "file" to check compression type, use bzip2 only when it +recognizes bzip2 or file ends in .bz2 + 'incsearch' with :s: (#3321) -- :/foo/s// changes last search pattern. Also E486. - :s/foo using CTRL-G moves to another line, should not happen, or use the correct line (it uses the last but one line) (Lifepillar, Aug 18, #3345) - Also support range: :/foo/,/bar/delete @@ -103,6 +105,9 @@ Does not build with MinGW out of the box: Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May 13, #2910) Can't reproduce? +Patch to add script line number to script ID. (ichizok, Ozaki Kiichi, 2018 Aug +24, #3362) + Errors found with random data: heap-buffer-overflow in alist_add (#2472) @@ -125,8 +130,8 @@ Related to bracketed paste. I cannot reproduce it. Patch in pull request #2967: Allow white space in sign text. (Ben Jackson) Test fails in AppVeyor. -Patch to add script line number to script ID. (ichizok, Ozaki Kiichi, 2018 Aug -24, #3362) +Job_info() returns command without backslashes. (Daniel Hahler, 2018 Sep 3, +#3404) Removing flags from 'cpoptions' breaks the Winbar buttons in termdebug. (Dominique Pelle, 2018 Jul 16) @@ -134,6 +139,10 @@ Removing flags from 'cpoptions' breaks the Winbar buttons in termdebug. Problem with two buffers with the same name a/b, if it didn't exist before and is created outside of Vim. (dskloetg, 2018 Jul 16, #3219) +Invalid memory access with old regexp engine. (Dominique Pelle, 2018 Sep 3, +#3405) Introduced by 8.0.1517, which was fixing another memory access error. +(Sep 8) + Memory leak in test_assert: ==19127== by 0x2640D7: alloc (misc2.c:874) ==19127== by 0x2646D6: vim_strsave (misc2.c:1315) @@ -188,8 +197,12 @@ Olaf Dabrunz is working on this. (10 Jan 2016) 9 Instead invoking an external diff program, use builtin code. One can be found here: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c It's complicated and badly documented. -Alternative: use the xdiff library. Unfinished Patch from Christian Brabandt, -2018 Mar 20, #2732) +Alternative: use the xdiff library from git. Unfinished Patch from Christian +Brabandt, 2018 Mar 20, #2732) +Note that this is NOT libxdiff. +-> avoid writing all the text to a file, use in-memory only +-> add option to use external diff above a certain size. +-> when making changes, diff only the part of the buffer that changed. Difference between two regexp engines: #3373 @@ -202,6 +215,9 @@ includes the first screen line. (2018 Aug 23, #3368) Refactored HTML indent file. (Michael Lee, #1821) +Test for user name completeion ":e ~s" fails because we don't get all +user names. Is there another function to get more? (2018 Sep 3, Stuckrad) + Patch to add getregpoint() and setreg() with an option to set "". (Andy Massimino, 2018 Aug 24, #3370) Better name? @@ -348,13 +364,6 @@ Add the debug command line history to viminfo. Avoid that "sign unplace id" does a redraw right away, esp. when there is a sequence of these commands. (Andy Stewart, 2018 Mar 16) -ch_sendraw() with long string does not try to read in between, which may cause -a deadlock if the reading side is waiting for the write to finish. (Nate -Bosch, 2018 Jan 13, #2548) -Perhaps just make chunks of 1024 bytes? -Probably better: Make the write non-blocking -Also a problem on MS-Windows: #2828. - Add Makefiles to the runtime/spell directory tree, since nobody uses Aap. Will have to explain the manual steps (downloading the .aff and .dic files, applying the diff, etc. diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index a0f0f3a1b1..c1cd8bb62c 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -67,10 +67,10 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps") vnoremap [[ m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "bW") nnoremap ]] m':call search('^\s*fu\%[nction]\>', "W") vnoremap ]] m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "W") - nnoremap [] m':call search('^\s*endf*\%[unction]\>', "bW") - vnoremap [] m':exe "normal! gv"call search('^\s*endf*\%[unction]\>', "bW") - nnoremap ][ m':call search('^\s*endf*\%[unction]\>', "W") - vnoremap ][ m':exe "normal! gv"call search('^\s*endf*\%[unction]\>', "W") + nnoremap [] m':call search('^\s*endf\%[unction]\>', "bW") + vnoremap [] m':exe "normal! gv"call search('^\s*endf\%[unction]\>', "bW") + nnoremap ][ m':call search('^\s*endf\%[unction]\>', "W") + vnoremap ][ m':exe "normal! gv"call search('^\s*endf\%[unction]\>', "W") " Move around comments nnoremap ]" :call search('^\(\s*".*\n\)\@ @@ -87,8 +87,7 @@ if exists("loaded_matchit") \ '\<\(wh\%[ile]\|for\)\>:\:\:\,' . \ '\:\:\,' . \ '\:\:\:\,' . - \ '\\)\@!\S:\,' . - \ '(:)' + \ '\\)\@!\S:\,' " Ignore syntax region commands and settings, any 'en*' would clobber " if-endif. " - set spl=de,en diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 167300c524..5e0d1fd76a 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Jul 31, 2018 -" Version: 179 +" Last Change: Sep 04, 2018 +" Version: 182 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) @@ -151,6 +151,7 @@ syn cluster shPPSRightList contains=shComment,shDeref,shDerefSimple,shEscape,shP syn cluster shSubShList contains=@shCommandSubList,shCommandSubBQ,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator syn cluster shTestList contains=shCharClass,shCommandSub,shCommandSubBQ,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shSpecialDQ,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr syn cluster shNoZSList contains=shSpecialNoZS +syn cluster shForList contains=shTestOpr,shNumber,shDerefSimple,shDeref,shCommandSub,shCommandSubBQ,shArithmetic " Echo: {{{1 " ==== @@ -243,7 +244,7 @@ syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum ShFoldIfDoFor syn region shDo transparent matchgroup=shConditional start="\" matchgroup=shConditional end="\" contains=@shLoopList ShFoldIfDoFor syn region shIf transparent matchgroup=shConditional start="\+ end="\<;\_s*then\>" end="\" contains=@shIfList ShFoldIfDoFor syn region shFor matchgroup=shLoop start="\ -" Last Change: Mar 30, 2018 -" Version: 109 +" Last Change: Sep 09, 2018 +" Version: 110 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " Notes: {{{1 @@ -596,7 +596,6 @@ if s:tex_fast =~# 'v' if exists("g:tex_verbspell") && g:tex_verbspell syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" contains=@Spell " listings package: - syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>" contains=@Spell if b:tex_stylish syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" contains=@Spell else @@ -683,13 +682,7 @@ if has("conceal") && &enc == 'utf-8' \ ['approx' , '≈'], \ ['ast' , '∗'], \ ['asymp' , '≍'], - \ ['backepsilon' , '∍'], - \ ['backsimeq' , '≃'], \ ['backslash' , '∖'], - \ ['barwedge' , '⊼'], - \ ['because' , '∵'], - \ ['beth' , 'ܒ'], - \ ['between' , '≬'], \ ['bigcap' , '∩'], \ ['bigcirc' , '○'], \ ['bigcup' , '∪'], @@ -701,38 +694,18 @@ if has("conceal") && &enc == 'utf-8' \ ['bigtriangleup' , '∆'], \ ['bigvee' , '⋁'], \ ['bigwedge' , '⋀'], - \ ['blacksquare' , '∎'], \ ['bot' , '⊥'], \ ['bowtie' , '⋈'], - \ ['boxdot' , '⊡'], - \ ['boxminus' , '⊟'], - \ ['boxplus' , '⊞'], - \ ['boxtimes' , '⊠'], - \ ['Box' , '☐'], \ ['bullet' , '•'], - \ ['bumpeq' , '≏'], - \ ['Bumpeq' , '≎'], \ ['cap' , '∩'], - \ ['Cap' , '⋒'], \ ['cdot' , '·'], \ ['cdots' , '⋯'], \ ['circ' , '∘'], - \ ['circeq' , '≗'], - \ ['circlearrowleft', '↺'], - \ ['circlearrowright', '↻'], - \ ['circledast' , '⊛'], - \ ['circledcirc' , '⊚'], \ ['clubsuit' , '♣'], - \ ['complement' , '∁'], \ ['cong' , '≅'], \ ['coprod' , '∐'], \ ['copyright' , '©'], \ ['cup' , '∪'], - \ ['Cup' , '⋓'], - \ ['curlyeqprec' , '⋞'], - \ ['curlyeqsucc' , '⋟'], - \ ['curlyvee' , '⋎'], - \ ['curlywedge' , '⋏'], \ ['dagger' , '†'], \ ['dashv' , '⊣'], \ ['ddagger' , '‡'], @@ -741,50 +714,27 @@ if has("conceal") && &enc == 'utf-8' \ ['diamondsuit' , '♢'], \ ['div' , '÷'], \ ['doteq' , '≐'], - \ ['doteqdot' , '≑'], - \ ['dotplus' , '∔'], \ ['dots' , '…'], - \ ['dotsb' , '⋯'], - \ ['dotsc' , '…'], - \ ['dotsi' , '⋯'], - \ ['dotso' , '…'], - \ ['doublebarwedge' , '⩞'], \ ['downarrow' , '↓'], \ ['Downarrow' , '⇓'], \ ['ell' , 'ℓ'], \ ['emptyset' , '∅'], - \ ['eqcirc' , '≖'], - \ ['eqsim' , '≂'], - \ ['eqslantgtr' , '⪖'], - \ ['eqslantless' , '⪕'], \ ['equiv' , '≡'], - \ ['eth' , 'ð'], \ ['exists' , '∃'], - \ ['fallingdotseq' , '≒'], \ ['flat' , '♭'], \ ['forall' , '∀'], \ ['frown' , '⁔'], \ ['ge' , '≥'], \ ['geq' , '≥'], - \ ['geqq' , '≧'], \ ['gets' , '←'], - \ ['gimel' , 'ℷ'], \ ['gg' , '⟫'], - \ ['gneqq' , '≩'], - \ ['gtrdot' , '⋗'], - \ ['gtreqless' , '⋛'], - \ ['gtrless' , '≷'], - \ ['gtrsim' , '≳'], \ ['hbar' , 'ℏ'], \ ['heartsuit' , '♡'], \ ['hookleftarrow' , '↩'], \ ['hookrightarrow' , '↪'], \ ['iff' , '⇔'], - \ ['iiint' , '∭'], - \ ['iint' , '∬'], \ ['Im' , 'ℑ'], \ ['imath' , 'ɩ'], - \ ['implies' , '⇒'], \ ['in' , '∈'], \ ['infty' , '∞'], \ ['int' , '∫'], @@ -793,69 +743,33 @@ if has("conceal") && &enc == 'utf-8' \ ['lceil' , '⌈'], \ ['ldots' , '…'], \ ['le' , '≤'], - \ ['leadsto' , '↝'], \ ['left(' , '('], \ ['left\[' , '['], \ ['left\\{' , '{'], \ ['leftarrow' , '←'], \ ['Leftarrow' , '⇐'], - \ ['leftarrowtail' , '↢'], \ ['leftharpoondown', '↽'], \ ['leftharpoonup' , '↼'], \ ['leftrightarrow' , '↔'], \ ['Leftrightarrow' , '⇔'], - \ ['leftrightsquigarrow', '↭'], - \ ['leftthreetimes' , '⋋'], \ ['leq' , '≤'], \ ['leq' , '≤'], - \ ['leqq' , '≦'], - \ ['lessdot' , '⋖'], - \ ['lesseqgtr' , '⋚'], - \ ['lesssim' , '≲'], \ ['lfloor' , '⌊'], \ ['ll' , '≪'], \ ['lmoustache' , '╭'], - \ ['lneqq' , '≨'], \ ['lor' , '∨'], - \ ['ltimes' , '⋉'], \ ['mapsto' , '↦'], - \ ['measuredangle' , '∡'], \ ['mid' , '∣'], \ ['models' , '╞'], \ ['mp' , '∓'], \ ['nabla' , '∇'], \ ['natural' , '♮'], - \ ['ncong' , '≇'], \ ['ne' , '≠'], \ ['nearrow' , '↗'], \ ['neg' , '¬'], \ ['neq' , '≠'], - \ ['nexists' , '∄'], - \ ['ngeq' , '≱'], - \ ['ngeqq' , '≱'], - \ ['ngtr' , '≯'], \ ['ni' , '∋'], - \ ['nleftarrow' , '↚'], - \ ['nLeftarrow' , '⇍'], - \ ['nLeftrightarrow', '⇎'], - \ ['nleq' , '≰'], - \ ['nleqq' , '≰'], - \ ['nless' , '≮'], - \ ['nmid' , '∤'], \ ['notin' , '∉'], - \ ['nparallel' , '∦'], - \ ['nprec' , '⊀'], - \ ['nrightarrow' , '↛'], - \ ['nRightarrow' , '⇏'], - \ ['nsim' , '≁'], - \ ['nsucc' , '⊁'], - \ ['ntriangleleft' , '⋪'], - \ ['ntrianglelefteq', '⋬'], - \ ['ntriangleright' , '⋫'], - \ ['ntrianglerighteq', '⋭'], - \ ['nvdash' , '⊬'], - \ ['nvDash' , '⊭'], - \ ['nVdash' , '⊮'], \ ['nwarrow' , '↖'], \ ['odot' , '⊙'], \ ['oint' , '∮'], @@ -868,15 +782,9 @@ if has("conceal") && &enc == 'utf-8' \ ['parallel' , '║'], \ ['partial' , '∂'], \ ['perp' , '⊥'], - \ ['pitchfork' , '⋔'], \ ['pm' , '±'], \ ['prec' , '≺'], - \ ['precapprox' , '⪷'], - \ ['preccurlyeq' , '≼'], \ ['preceq' , '⪯'], - \ ['precnapprox' , '⪹'], - \ ['precneqq' , '⪵'], - \ ['precsim' , '≾'], \ ['prime' , '′'], \ ['prod' , '∏'], \ ['propto' , '∝'], @@ -888,13 +796,8 @@ if has("conceal") && &enc == 'utf-8' \ ['right\\}' , '}'], \ ['rightarrow' , '→'], \ ['Rightarrow' , '⇒'], - \ ['rightarrowtail' , '↣'], \ ['rightleftharpoons', '⇌'], - \ ['rightsquigarrow', '↝'], - \ ['rightthreetimes', '⋌'], - \ ['risingdotseq' , '≓'], \ ['rmoustache' , '╮'], - \ ['rtimes' , '⋊'], \ ['S' , '§'], \ ['searrow' , '↘'], \ ['setminus' , '∖'], @@ -903,7 +806,6 @@ if has("conceal") && &enc == 'utf-8' \ ['simeq' , '⋍'], \ ['smile' , '‿'], \ ['spadesuit' , '♠'], - \ ['sphericalangle' , '∢'], \ ['sqcap' , '⊓'], \ ['sqcup' , '⊔'], \ ['sqsubset' , '⊏'], @@ -912,60 +814,30 @@ if has("conceal") && &enc == 'utf-8' \ ['sqsupseteq' , '⊒'], \ ['star' , '✫'], \ ['subset' , '⊂'], - \ ['Subset' , '⋐'], \ ['subseteq' , '⊆'], - \ ['subseteqq' , '⫅'], - \ ['subsetneq' , '⊊'], - \ ['subsetneqq' , '⫋'], \ ['succ' , '≻'], - \ ['succapprox' , '⪸'], - \ ['succcurlyeq' , '≽'], \ ['succeq' , '⪰'], - \ ['succnapprox' , '⪺'], - \ ['succneqq' , '⪶'], - \ ['succsim' , '≿'], \ ['sum' , '∑'], \ ['supset' , '⊃'], - \ ['Supset' , '⋑'], \ ['supseteq' , '⊇'], - \ ['supseteqq' , '⫆'], - \ ['supsetneq' , '⊋'], - \ ['supsetneqq' , '⫌'], \ ['surd' , '√'], \ ['swarrow' , '↙'], - \ ['therefore' , '∴'], \ ['times' , '×'], \ ['to' , '→'], \ ['top' , '⊤'], \ ['triangle' , '∆'], \ ['triangleleft' , '⊲'], - \ ['trianglelefteq' , '⊴'], - \ ['triangleq' , '≜'], \ ['triangleright' , '⊳'], - \ ['trianglerighteq', '⊵'], - \ ['twoheadleftarrow', '↞'], - \ ['twoheadrightarrow', '↠'], - \ ['ulcorner' , '⌜'], \ ['uparrow' , '↑'], \ ['Uparrow' , '⇑'], \ ['updownarrow' , '↕'], \ ['Updownarrow' , '⇕'], - \ ['urcorner' , '⌝'], - \ ['varnothing' , '∅'], - \ ['vartriangle' , '∆'], \ ['vdash' , '⊢'], - \ ['vDash' , '⊨'], - \ ['Vdash' , '⊩'], \ ['vdots' , '⋮'], \ ['vee' , '∨'], - \ ['veebar' , '⊻'], - \ ['Vvdash' , '⊪'], \ ['wedge' , '∧'], \ ['wp' , '℘'], \ ['wr' , '≀']] -" \ ['jmath' , 'X'] -" \ ['uminus' , 'X'] -" \ ['uplus' , 'X'] if &ambw == "double" || exists("g:tex_usedblwidth") let s:texMathList= s:texMathList + [ \ ['right\\rangle' , '〉'], diff --git a/runtime/tutor/tutor.ru b/runtime/tutor/tutor.ru index be6c1bd2f3..f4bc62e863 100644 --- a/runtime/tutor/tutor.ru +++ b/runtime/tutor/tutor.ru @@ -540,7 +540,7 @@ ---> "" `'; . -! , +! , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -607,15 +607,15 @@ . 4. `' `' , - :s/old/new + :s// `' `' , - :s/old/new/g + :s///g , - :#,#s/old/new/g + :#,#s///g `' `' , - :%s/old/new/g + :%s///g , 'c' - :%s/old/new/gc + :%s///gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.1: diff --git a/runtime/tutor/tutor.ru.cp1251 b/runtime/tutor/tutor.ru.cp1251 index 1cff3eae7d..39a0019b85 100644 --- a/runtime/tutor/tutor.ru.cp1251 +++ b/runtime/tutor/tutor.ru.cp1251 @@ -540,7 +540,7 @@ ---> "" `'; . -! , +! , . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -607,15 +607,15 @@ . 4. `' `' , - :s/old/new + :s// `' `' , - :s/old/new/g + :s///g , - :#,#s/old/new/g + :#,#s///g `' `' , - :%s/old/new/g + :%s///g , 'c' - :%s/old/new/gc + :%s///gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.1: diff --git a/src/Make_all.mak b/src/Make_all.mak index 49ad4f0af8..79b8b94798 100644 --- a/src/Make_all.mak +++ b/src/Make_all.mak @@ -2,7 +2,8 @@ # Common Makefile, defines the list of tests to run. # -# Individual tests, including the ones part of test_alot +# Individual tests, including the ones part of test_alot. +# Please keep sorted up to test_alot. NEW_TESTS = \ test_arglist \ test_arabic \ @@ -52,6 +53,7 @@ NEW_TESTS = \ test_exists_autocmd \ test_expand \ test_expand_dllpath \ + test_expand_func \ test_expr \ test_expr_utf8 \ test_farsi \ diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index 16cd71259c..2308135b52 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -166,6 +166,25 @@ else ifndef CROSS_COMPILE CROSS_COMPILE = endif + +# About the "sh.exe" condition, as explained by Ken Takata: +# +# If the makefile is executed with mingw32-make and sh.exe is not found in +# $PATH, then $SHELL is set to "sh.exe" (without any path). In this case, +# unix-like commands might not work and a dos-style path is needed. +# +# If the makefile is executed with mingw32-make and sh.exe IS found in $PATH, +# then $SHELL is set with the actual path of sh.exe (e.g. +# "C:/msys64/usr/bin/sh.exe"). In this case, unix-like commands can be used. +# +# If it is executed by the "make" command from cmd.exe, $SHELL is set to +# "/bin/sh". If the "make" command is in the $PATH, other unix-like commands +# might also work. +# +# If it is executed by the "make" command from a unix-like shell, +# $SHELL is set with the unix-style path (e.g. "/bin/bash"). +# In this case, unix-like commands can be used. +# ifneq (sh.exe, $(SHELL)) DEL = rm MKDIR = mkdir -p @@ -810,6 +829,23 @@ OBJ += $(OUTDIR)/terminal.o \ $(OUTDIR)/term_vterm.o endif +# Include xdiff +OBJ += $(OUTDIR)/xdiffi.o \ + $(OUTDIR)/xemit.o \ + $(OUTDIR)/xprepare.o \ + $(OUTDIR)/xutils.o \ + $(OUTDIR)/xhistogram.o \ + $(OUTDIR)/xpatience.o + +XDIFF_DEPS = \ + xdiff/xdiff.h \ + xdiff/xdiffi.h \ + xdiff/xemit.h \ + xdiff/xinclude.h \ + xdiff/xmacros.h \ + xdiff/xprepare.h \ + xdiff/xtypes.h \ + xdiff/xutils.h ifdef MZSCHEME MZSCHEME_SUFFIX = Z @@ -1055,6 +1091,23 @@ $(OUTDIR)/term_unicode.o: libvterm/src/unicode.c $(TERM_DEPS) $(OUTDIR)/term_vterm.o: libvterm/src/vterm.c $(TERM_DEPS) $(CCCTERM) libvterm/src/vterm.c -o $@ +$(OUTDIR)/xdiffi.o: xdiff/xdiffi.c $(XDIFF_DEPS) + $(CC) -c $(CFLAGS) xdiff/xdiffi.c -o $(OUTDIR)/xdiffi.o + +$(OUTDIR)/xemit.o: xdiff/xemit.c $(XDIFF_DEPS) + $(CC) -c $(CFLAGS) xdiff/xemit.c -o $(OUTDIR)/xemit.o + +$(OUTDIR)/xprepare.o: xdiff/xprepare.c $(XDIFF_DEPS) + $(CC) -c $(CFLAGS) xdiff/xprepare.c -o $(OUTDIR)/xprepare.o + +$(OUTDIR)/xutils.o: xdiff/xutils.c $(XDIFF_DEPS) + $(CC) -c $(CFLAGS) xdiff/xutils.c -o $(OUTDIR)/xutils.o + +$(OUTDIR)/xhistogram.o: xdiff/xhistogram.c $(XDIFF_DEPS) + $(CC) -c $(CFLAGS) xdiff/xhistogram.c -o $(OUTDIR)/xhistogram.o + +$(OUTDIR)/xpatience.o: xdiff/xpatience.c $(XDIFF_DEPS) + $(CC) -c $(CFLAGS) xdiff/xpatience.c -o $(OUTDIR)/xpatience.o pathdef.c: $(INCL) ifneq (sh.exe, $(SHELL)) diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index f32903392e..1131f2b05f 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -813,6 +813,24 @@ CUI_OBJ = $(OUTDIR)\iscygpty.obj !endif SUBSYSTEM_TOOLS = console +XDIFF_OBJ = $(OBJDIR)/xdiffi.obj \ + $(OBJDIR)/xemit.obj \ + $(OBJDIR)/xprepare.obj \ + $(OBJDIR)/xutils.obj \ + $(OBJDIR)/xhistogram.obj \ + $(OBJDIR)/xpatience.obj + +XDIFF_DEPS = \ + xdiff/xdiff.h \ + xdiff/xdiffi.h \ + xdiff/xemit.h \ + xdiff/xinclude.h \ + xdiff/xmacros.h \ + xdiff/xprepare.h \ + xdiff/xtypes.h \ + xdiff/xutils.h + + !if "$(SUBSYSTEM_VER)" != "" SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER) SUBSYSTEM_TOOLS = $(SUBSYSTEM_TOOLS),$(SUBSYSTEM_VER) @@ -1204,12 +1222,12 @@ all: $(VIM).exe \ tee/tee.exe \ GvimExt/gvimext.dll -$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \ +$(VIM).exe: $(OUTDIR) $(OBJ) $(XDIFF_OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \ $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \ $(CSCOPE_OBJ) $(TERM_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \ version.c version.h $(CC) $(CFLAGS_OUTDIR) version.c - $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) \ + $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(XDIFF_OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) \ $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \ $(TCL_OBJ) $(CSCOPE_OBJ) $(TERM_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \ $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2) @@ -1304,6 +1322,7 @@ $(NEW_TESTS): $(MAKE) /NOLOGO -f Make_dos.mak nolog $(MAKE) /NOLOGO -f Make_dos.mak $@.res $(MAKE) /NOLOGO -f Make_dos.mak report + cat messages cd .. ########################################################################### @@ -1344,6 +1363,24 @@ $(OUTDIR)/dict.obj: $(OUTDIR) dict.c $(INCL) $(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL) +$(OUTDIR)/xdiffi.obj: $(OUTDIR) xdiff/xdiffi.c $(XDIFF_DEPS) + $(CC) $(CFLAGS_OUTDIR) xdiff/xdiffi.c + +$(OUTDIR)/xemit.obj: $(OUTDIR) xdiff/xemit.c $(XDIFF_DEPS) + $(CC) $(CFLAGS_OUTDIR) xdiff/xemit.c + +$(OUTDIR)/xprepare.obj: $(OUTDIR) xdiff/xprepare.c $(XDIFF_DEPS) + $(CC) $(CFLAGS_OUTDIR) xdiff/xprepare.c + +$(OUTDIR)/xutils.obj: $(OUTDIR) xdiff/xutils.c $(XDIFF_DEPS) + $(CC) $(CFLAGS_OUTDIR) xdiff/xutils.c + +$(OUTDIR)/xhistogram.obj: $(OUTDIR) xdiff/xhistogram.c $(XDIFF_DEPS) + $(CC) $(CFLAGS_OUTDIR) xdiff/xhistogram.c + +$(OUTDIR)/xpatience.obj: $(OUTDIR) xdiff/xpatience.c $(XDIFF_DEPS) + $(CC) $(CFLAGS_OUTDIR) xdiff/xpatience.c + $(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL) $(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL) diff --git a/src/Makefile b/src/Makefile index bc08f2d3b7..17b77b1c63 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1417,6 +1417,32 @@ TERM_DEPS = \ TERM_SRC = libvterm/src/*.c +XDIFF_SRC = \ + xdiff/xdiffi.c \ + xdiff/xemit.c \ + xdiff/xprepare.c \ + xdiff/xutils.c \ + xdiff/xhistogram.c \ + xdiff/xpatience.c \ + +XDIFF_OBJS = \ + objects/xdiffi.o \ + objects/xemit.o \ + objects/xprepare.o \ + objects/xutils.o \ + objects/xhistogram.o \ + objects/xpatience.o \ + +XDIFF_INCL = \ + xdiff/xdiff.h \ + xdiff/xdiffi.h \ + xdiff/xemit.h \ + xdiff/xinclude.h \ + xdiff/xmacros.h \ + xdiff/xprepare.h \ + xdiff/xtypes.h \ + xdiff/xutils.h \ + ### Command to create dependencies based on #include "..." ### prototype headers are ignored due to -DPROTO, system ### headers #include <...> are ignored if we use the -MM option, as @@ -1628,6 +1654,7 @@ BASIC_SRC = \ SRC = $(BASIC_SRC) \ $(GUI_SRC) \ $(TERM_SRC) \ + $(XDIFF_SRC) \ $(HANGULIN_SRC) \ $(LUA_SRC) \ $(MZSCHEME_SRC) \ @@ -1745,6 +1772,7 @@ OBJ_COMMON = \ $(WORKSHOP_OBJ) \ $(NETBEANS_OBJ) \ $(CHANNEL_OBJ) \ + $(XDIFF_OBJS) \ $(WSDEBUG_OBJ) # The files included by tests are not in OBJ_COMMON. @@ -2748,7 +2776,7 @@ SHADOWDIR = shadow shadow: runtime pixmaps $(MKDIR_P) $(SHADOWDIR) - cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../libvterm ../vimtutor ../gvimtutor ../install-sh ../Make_all.mak . + cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../xdiff ../libvterm ../vimtutor ../gvimtutor ../install-sh ../Make_all.mak . mkdir $(SHADOWDIR)/auto cd $(SHADOWDIR)/auto; ln -s ../../auto/configure . $(MKDIR_P) $(SHADOWDIR)/po @@ -2938,7 +2966,7 @@ objects/crypt_zip.o: crypt_zip.c objects/dict.o: dict.c $(CCC) -o $@ dict.c -objects/diff.o: diff.c +objects/diff.o: diff.c $(XDIFF_INCL) $(CCC) -o $@ diff.c objects/digraph.o: digraph.c @@ -3255,6 +3283,27 @@ objects/term_unicode.o: libvterm/src/unicode.c $(TERM_DEPS) objects/term_vterm.o: libvterm/src/vterm.c $(TERM_DEPS) $(CCCTERM) -o $@ libvterm/src/vterm.c +CCCDIFF = $(CCC_NF) $(ALL_CFLAGS) + +objects/xdiffi.o: xdiff/xdiffi.c $(XDIFF_INCL) + $(CCCDIFF) -o $@ xdiff/xdiffi.c + +objects/xprepare.o: xdiff/xprepare.c $(XDIFF_INCL) + $(CCCDIFF) -o $@ xdiff/xprepare.c + +objects/xutils.o: xdiff/xutils.c $(XDIFF_INCL) + $(CCCDIFF) -o $@ xdiff/xutils.c + +objects/xemit.o: xdiff/xemit.c $(XDIFF_INCL) + $(CCCDIFF) -o $@ xdiff/xemit.c + +objects/xhistogram.o: xdiff/xhistogram.c $(XDIFF_INCL) + $(CCCDIFF) -o $@ xdiff/xhistogram.c + +objects/xpatience.o: xdiff/xpatience.c $(XDIFF_INCL) + $(CCCDIFF) -o $@ xdiff/xpatience.c + + ############################################################################### ### MacOS X installation ### diff --git a/src/buffer.c b/src/buffer.c index 7b93a4a9bd..ad65ba6a70 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5422,7 +5422,7 @@ chk_modeline( char_u *save_sourcing_name; linenr_T save_sourcing_lnum; #ifdef FEAT_EVAL - scid_T save_SID; + sctx_T save_current_sctx; #endif prev = -1; @@ -5507,12 +5507,13 @@ chk_modeline( if (*s != NUL) /* skip over an empty "::" */ { #ifdef FEAT_EVAL - save_SID = current_SID; - current_SID = SID_MODELINE; + save_current_sctx = current_sctx; + current_sctx.sc_sid = SID_MODELINE; + current_sctx.sc_lnum = 0; #endif retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags); #ifdef FEAT_EVAL - current_SID = save_SID; + current_sctx = save_current_sctx; #endif if (retval == FAIL) /* stop if error found */ break; diff --git a/src/diff.c b/src/diff.c index c67654f621..4c0792baae 100644 --- a/src/diff.c +++ b/src/diff.c @@ -9,23 +9,32 @@ /* * diff.c: code for diff'ing two, three or four buffers. + * + * There are three ways to diff: + * - Shell out to an external diff program, using files. + * - Use the compiled-in xdiff library. + * - Let 'diffexpr' do the work, using files. */ #include "vim.h" +#include "xdiff/xdiff.h" #if defined(FEAT_DIFF) || defined(PROTO) static int diff_busy = FALSE; /* ex_diffgetput() is busy */ /* flags obtained from the 'diffopt' option */ -#define DIFF_FILLER 1 /* display filler lines */ -#define DIFF_ICASE 2 /* ignore case */ -#define DIFF_IWHITE 4 /* ignore change in white space */ -#define DIFF_HORIZONTAL 8 /* horizontal splits */ -#define DIFF_VERTICAL 16 /* vertical splits */ -#define DIFF_HIDDEN_OFF 32 /* diffoff when hidden */ +#define DIFF_FILLER 1 // display filler lines +#define DIFF_ICASE 2 // ignore case +#define DIFF_IWHITE 4 // ignore change in white space +#define DIFF_HORIZONTAL 8 // horizontal splits +#define DIFF_VERTICAL 16 // vertical splits +#define DIFF_HIDDEN_OFF 32 // diffoff when hidden +#define DIFF_INTERNAL 64 // use internal xdiff algorithm static int diff_flags = DIFF_FILLER; +static long diff_algorithm = 0; + #define LBUFLEN 50 /* length of line in diff file */ static int diff_a_works = MAYBE; /* TRUE when "diff -a" works, FALSE when it @@ -36,22 +45,45 @@ static int diff_bin_works = MAYBE; /* TRUE when "diff --binary" works, FALSE checked yet */ #endif +// used for diff input +typedef struct { + char_u *din_fname; // used for external diff + mmfile_t din_mmfile; // used for internal diff +} diffin_T; + +// used for diff result +typedef struct { + char_u *dout_fname; // used for external diff + garray_T dout_ga; // used for internal diff +} diffout_T; + +// two diff inputs and one result +typedef struct { + diffin_T dio_orig; // original file input + diffin_T dio_new; // new file input + diffout_T dio_diff; // diff result + int dio_internal; // using internal diff +} diffio_T; + static int diff_buf_idx(buf_T *buf); static int diff_buf_idx_tp(buf_T *buf, tabpage_T *tp); static void diff_mark_adjust_tp(tabpage_T *tp, int idx, linenr_T line1, linenr_T line2, long amount, long amount_after); static void diff_check_unchanged(tabpage_T *tp, diff_T *dp); static int diff_check_sanity(tabpage_T *tp, diff_T *dp); static void diff_redraw(int dofold); -static int diff_write(buf_T *buf, char_u *fname); -static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff); +static int check_external_diff(diffio_T *diffio); +static int diff_file(diffio_T *diffio); static int diff_equal_entry(diff_T *dp, int idx1, int idx2); static int diff_cmp(char_u *s1, char_u *s2); #ifdef FEAT_FOLDING static void diff_fold_update(diff_T *dp, int skip_idx); #endif -static void diff_read(int idx_orig, int idx_new, char_u *fname); +static void diff_read(int idx_orig, int idx_new, diffout_T *fname); static void diff_copy_entry(diff_T *dprev, diff_T *dp, int idx_orig, int idx_new); static diff_T *diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp); +static int parse_diff_ed(char_u *line, linenr_T *lnum_orig, long *count_orig, linenr_T *lnum_new, long *count_new); +static int parse_diff_unified(char_u *line, linenr_T *lnum_orig, long *count_orig, linenr_T *lnum_new, long *count_new); +static int xdiff_out(void *priv, mmbuffer_t *mb, int nbuf); #ifndef USE_CR # define tag_fgets vim_fgets @@ -631,26 +663,224 @@ diff_redraw( } } + static void +clear_diffin(diffin_T *din) +{ + if (din->din_fname == NULL) + { + vim_free(din->din_mmfile.ptr); + din->din_mmfile.ptr = NULL; + } + else + mch_remove(din->din_fname); +} + + static void +clear_diffout(diffout_T *dout) +{ + if (dout->dout_fname == NULL) + ga_clear_strings(&dout->dout_ga); + else + mch_remove(dout->dout_fname); +} + /* - * Write buffer "buf" to file "name". - * Always use 'fileformat' set to "unix". - * Return FAIL for failure + * Write buffer "buf" to a memory buffer. + * Return FAIL for failure. */ static int -diff_write(buf_T *buf, char_u *fname) +diff_write_buffer(buf_T *buf, diffin_T *din) +{ + linenr_T lnum; + char_u *s; + long len = 0; + char_u *ptr; + + // xdiff requires one big block of memory with all the text. + for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum) + len += STRLEN(ml_get_buf(buf, lnum, FALSE)) + 1; + ptr = lalloc(len, TRUE); + if (ptr == NULL) + { + // Allocating memory failed. This can happen, because we try to read + // the whole buffer text into memory. Set the failed flag, the diff + // will be retried with external diff. The flag is never reset. + buf->b_diff_failed = TRUE; + if (p_verbose > 0) + { + verbose_enter(); + smsg((char_u *) + _("Not enough memory to use internal diff for buffer \"%s\""), + buf->b_fname); + verbose_leave(); + } + return FAIL; + } + din->din_mmfile.ptr = (char *)ptr; + din->din_mmfile.size = len; + + len = 0; + for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum) + { + for (s = ml_get_buf(buf, lnum, FALSE); *s != NUL; ) + { + if (diff_flags & DIFF_ICASE) + { + int c; + + // xdiff doesn't support ignoring case, fold-case the text. +#ifdef FEAT_MBYTE + int orig_len; + char_u cbuf[MB_MAXBYTES + 1]; + + c = PTR2CHAR(s); + c = enc_utf8 ? utf_fold(c) : MB_TOLOWER(c); + orig_len = MB_PTR2LEN(s); + if (mb_char2bytes(c, cbuf) != orig_len) + // TODO: handle byte length difference + mch_memmove(ptr + len, s, orig_len); + else + mch_memmove(ptr + len, cbuf, orig_len); + + s += orig_len; + len += orig_len; +#else + c = *s++; + ptr[len++] = TOLOWER_LOC(c); +#endif + } + else + ptr[len++] = *s++; + } + ptr[len++] = NL; + } + return OK; +} + +/* + * Write buffer "buf" to file or memory buffer. + * Return FAIL for failure. + */ + static int +diff_write(buf_T *buf, diffin_T *din) { int r; char_u *save_ff; + if (din->din_fname == NULL) + return diff_write_buffer(buf, din); + + // Always use 'fileformat' set to "unix". save_ff = buf->b_p_ff; buf->b_p_ff = vim_strsave((char_u *)FF_UNIX); - r = buf_write(buf, fname, NULL, (linenr_T)1, buf->b_ml.ml_line_count, - NULL, FALSE, FALSE, FALSE, TRUE); + r = buf_write(buf, din->din_fname, NULL, + (linenr_T)1, buf->b_ml.ml_line_count, + NULL, FALSE, FALSE, FALSE, TRUE); free_string_option(buf->b_p_ff); buf->b_p_ff = save_ff; return r; } +/* + * Update the diffs for all buffers involved. + */ + static void +diff_try_update( + diffio_T *dio, + int idx_orig, + exarg_T *eap) // "eap" can be NULL +{ + buf_T *buf; + int idx_new; + + if (dio->dio_internal) + { + ga_init2(&dio->dio_diff.dout_ga, sizeof(char *), 1000); + } + else + { + // We need three temp file names. + dio->dio_orig.din_fname = vim_tempname('o', TRUE); + dio->dio_new.din_fname = vim_tempname('n', TRUE); + dio->dio_diff.dout_fname = vim_tempname('d', TRUE); + if (dio->dio_orig.din_fname == NULL + || dio->dio_new.din_fname == NULL + || dio->dio_diff.dout_fname == NULL) + goto theend; + } + + // Check external diff is actually working. + if (!dio->dio_internal && check_external_diff(dio) == FAIL) + goto theend; + + // :diffupdate! + if (eap != NULL && eap->forceit) + for (idx_new = idx_orig; idx_new < DB_COUNT; ++idx_new) + { + buf = curtab->tp_diffbuf[idx_new]; + if (buf_valid(buf)) + buf_check_timestamp(buf, FALSE); + } + + // Write the first buffer to a tempfile or mmfile_t. + buf = curtab->tp_diffbuf[idx_orig]; + if (diff_write(buf, &dio->dio_orig) == FAIL) + goto theend; + + // Make a difference between the first buffer and every other. + for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new) + { + buf = curtab->tp_diffbuf[idx_new]; + if (buf == NULL || buf->b_ml.ml_mfp == NULL) + continue; // skip buffer that isn't loaded + + // Write the other buffer and diff with the first one. + if (diff_write(buf, &dio->dio_new) == FAIL) + continue; + if (diff_file(dio) == FAIL) + continue; + + // Read the diff output and add each entry to the diff list. + diff_read(idx_orig, idx_new, &dio->dio_diff); + + clear_diffin(&dio->dio_new); + clear_diffout(&dio->dio_diff); + } + clear_diffin(&dio->dio_orig); + +theend: + vim_free(dio->dio_orig.din_fname); + vim_free(dio->dio_new.din_fname); + vim_free(dio->dio_diff.dout_fname); +} + +/* + * Return TRUE if the options are set to use the internal diff library. + * Note that if the internal diff failed for one of the buffers, the external + * diff will be used anyway. + */ + static int +diff_internal(void) +{ + return (diff_flags & DIFF_INTERNAL) != 0 && *p_dex == NUL; +} + +/* + * Return TRUE if the internal diff failed for one of the diff buffers. + */ + static int +diff_internal_failed(void) +{ + int idx; + + // Only need to do something when there is another buffer. + for (idx = 0; idx < DB_COUNT; ++idx) + if (curtab->tp_diffbuf[idx] != NULL + && curtab->tp_diffbuf[idx]->b_diff_failed) + return TRUE; + return FALSE; +} + /* * Completely update the diffs for the buffers involved. * This uses the ordinary "diff" command. @@ -658,54 +888,65 @@ diff_write(buf_T *buf, char_u *fname) * could have been produced by autocommands, e.g. the netrw plugin). */ void -ex_diffupdate( - exarg_T *eap) /* can be NULL */ +ex_diffupdate(exarg_T *eap) // "eap" can be NULL { - buf_T *buf; int idx_orig; int idx_new; - char_u *tmp_orig; - char_u *tmp_new; - char_u *tmp_diff; - FILE *fd; - int ok; - int io_error = FALSE; + diffio_T diffio; - /* Delete all diffblocks. */ + // Delete all diffblocks. diff_clear(curtab); curtab->tp_diff_invalid = FALSE; - /* Use the first buffer as the original text. */ + // Use the first buffer as the original text. for (idx_orig = 0; idx_orig < DB_COUNT; ++idx_orig) if (curtab->tp_diffbuf[idx_orig] != NULL) break; if (idx_orig == DB_COUNT) return; - /* Only need to do something when there is another buffer. */ + // Only need to do something when there is another buffer. for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new) if (curtab->tp_diffbuf[idx_new] != NULL) break; if (idx_new == DB_COUNT) return; - /* We need three temp file names. */ - tmp_orig = vim_tempname('o', TRUE); - tmp_new = vim_tempname('n', TRUE); - tmp_diff = vim_tempname('d', TRUE); - if (tmp_orig == NULL || tmp_new == NULL || tmp_diff == NULL) - goto theend; + // Only use the internal method if it did not fail for one of the buffers. + vim_memset(&diffio, 0, sizeof(diffio)); + diffio.dio_internal = diff_internal() && !diff_internal_failed(); - /* - * Do a quick test if "diff" really works. Otherwise it looks like there - * are no differences. Can't use the return value, it's non-zero when - * there are differences. - * May try twice, first with "-a" and then without. - */ + diff_try_update(&diffio, idx_orig, eap); + if (diffio.dio_internal && diff_internal_failed()) + { + // Internal diff failed, use external diff instead. + vim_memset(&diffio, 0, sizeof(diffio)); + diff_try_update(&diffio, idx_orig, eap); + } + + // force updating cursor position on screen + curwin->w_valid_cursor.lnum = 0; + + diff_redraw(TRUE); +} + +/* + * Do a quick test if "diff" really works. Otherwise it looks like there + * are no differences. Can't use the return value, it's non-zero when + * there are differences. + */ + static int +check_external_diff(diffio_T *diffio) +{ + FILE *fd; + int ok; + int io_error = FALSE; + + // May try twice, first with "-a" and then without. for (;;) { ok = FALSE; - fd = mch_fopen((char *)tmp_orig, "w"); + fd = mch_fopen((char *)diffio->dio_orig.din_fname, "w"); if (fd == NULL) io_error = TRUE; else @@ -713,7 +954,7 @@ ex_diffupdate( if (fwrite("line1\n", (size_t)6, (size_t)1, fd) != 1) io_error = TRUE; fclose(fd); - fd = mch_fopen((char *)tmp_new, "w"); + fd = mch_fopen((char *)diffio->dio_new.din_fname, "w"); if (fd == NULL) io_error = TRUE; else @@ -721,8 +962,9 @@ ex_diffupdate( if (fwrite("line2\n", (size_t)6, (size_t)1, fd) != 1) io_error = TRUE; fclose(fd); - diff_file(tmp_orig, tmp_new, tmp_diff); - fd = mch_fopen((char *)tmp_diff, "r"); + fd = NULL; + if (diff_file(diffio) == OK) + fd = mch_fopen((char *)diffio->dio_diff.dout_fname, "r"); if (fd == NULL) io_error = TRUE; else @@ -739,10 +981,10 @@ ex_diffupdate( } fclose(fd); } - mch_remove(tmp_diff); - mch_remove(tmp_new); + mch_remove(diffio->dio_diff.dout_fname); + mch_remove(diffio->dio_new.din_fname); } - mch_remove(tmp_orig); + mch_remove(diffio->dio_orig.din_fname); } #ifdef FEAT_EVAL @@ -785,98 +1027,101 @@ ex_diffupdate( #if defined(MSWIN) diff_bin_works = MAYBE; #endif - goto theend; + return FAIL; } + return OK; +} - /* :diffupdate! */ - if (eap != NULL && eap->forceit) - for (idx_new = idx_orig; idx_new < DB_COUNT; ++idx_new) - { - buf = curtab->tp_diffbuf[idx_new]; - if (buf_valid(buf)) - buf_check_timestamp(buf, FALSE); - } +/* + * Invoke the xdiff function. + */ + static int +diff_file_internal(diffio_T *diffio) +{ + xpparam_t param; + xdemitconf_t emit_cfg; + xdemitcb_t emit_cb; - /* Write the first buffer to a tempfile. */ - buf = curtab->tp_diffbuf[idx_orig]; - if (diff_write(buf, tmp_orig) == FAIL) - goto theend; + vim_memset(¶m, 0, sizeof(param)); + vim_memset(&emit_cfg, 0, sizeof(emit_cfg)); + vim_memset(&emit_cb, 0, sizeof(emit_cb)); - /* Make a difference between the first buffer and every other. */ - for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new) + param.flags = diff_algorithm; + + if (diff_flags & DIFF_IWHITE) + param.flags |= XDF_IGNORE_WHITESPACE_CHANGE; + + emit_cfg.ctxlen = 0; // don't need any diff_context here + emit_cb.priv = &diffio->dio_diff; + emit_cb.outf = xdiff_out; + if (xdl_diff(&diffio->dio_orig.din_mmfile, + &diffio->dio_new.din_mmfile, + ¶m, &emit_cfg, &emit_cb) < 0) { - buf = curtab->tp_diffbuf[idx_new]; - if (buf == NULL || buf->b_ml.ml_mfp == NULL) - continue; /* skip buffer that isn't loaded */ - if (diff_write(buf, tmp_new) == FAIL) - continue; - diff_file(tmp_orig, tmp_new, tmp_diff); - - /* Read the diff output and add each entry to the diff list. */ - diff_read(idx_orig, idx_new, tmp_diff); - mch_remove(tmp_diff); - mch_remove(tmp_new); + EMSG(_("E960: Problem creating the internal diff")); + return FAIL; } - mch_remove(tmp_orig); - - /* force updating cursor position on screen */ - curwin->w_valid_cursor.lnum = 0; - - diff_redraw(TRUE); - -theend: - vim_free(tmp_orig); - vim_free(tmp_new); - vim_free(tmp_diff); + return OK; } /* * Make a diff between files "tmp_orig" and "tmp_new", results in "tmp_diff". + * return OK or FAIL; */ - static void -diff_file( - char_u *tmp_orig, - char_u *tmp_new, - char_u *tmp_diff) + static int +diff_file(diffio_T *dio) { char_u *cmd; size_t len; + char_u *tmp_orig = dio->dio_orig.din_fname; + char_u *tmp_new = dio->dio_new.din_fname; + char_u *tmp_diff = dio->dio_diff.dout_fname; #ifdef FEAT_EVAL if (*p_dex != NUL) - /* Use 'diffexpr' to generate the diff file. */ + { + // Use 'diffexpr' to generate the diff file. eval_diff(tmp_orig, tmp_new, tmp_diff); + return OK; + } else #endif + // Use xdiff for generating the diff. + if (dio->dio_internal) + { + return diff_file_internal(dio); + } + else { len = STRLEN(tmp_orig) + STRLEN(tmp_new) + STRLEN(tmp_diff) + STRLEN(p_srr) + 27; cmd = alloc((unsigned)len); - if (cmd != NULL) - { - /* We don't want $DIFF_OPTIONS to get in the way. */ - if (getenv("DIFF_OPTIONS")) - vim_setenv((char_u *)"DIFF_OPTIONS", (char_u *)""); + if (cmd == NULL) + return FAIL; - /* Build the diff command and execute it. Always use -a, binary - * differences are of no use. Ignore errors, diff returns - * non-zero when differences have been found. */ - vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s", - diff_a_works == FALSE ? "" : "-a ", + // We don't want $DIFF_OPTIONS to get in the way. + if (getenv("DIFF_OPTIONS")) + vim_setenv((char_u *)"DIFF_OPTIONS", (char_u *)""); + + // Build the diff command and execute it. Always use -a, binary + // differences are of no use. Ignore errors, diff returns + // non-zero when differences have been found. + vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s", + diff_a_works == FALSE ? "" : "-a ", #if defined(MSWIN) - diff_bin_works == TRUE ? "--binary " : "", + diff_bin_works == TRUE ? "--binary " : "", #else - "", + "", #endif - (diff_flags & DIFF_IWHITE) ? "-b " : "", - (diff_flags & DIFF_ICASE) ? "-i " : "", - tmp_orig, tmp_new); - append_redir(cmd, (int)len, p_srr, tmp_diff); - block_autocmds(); /* Avoid ShellCmdPost stuff */ - (void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT); - unblock_autocmds(); - vim_free(cmd); - } + (diff_flags & DIFF_IWHITE) ? "-b " : "", + (diff_flags & DIFF_ICASE) ? "-i " : "", + tmp_orig, tmp_new); + append_redir(cmd, (int)len, p_srr, tmp_diff); + block_autocmds(); // avoid ShellCmdPost stuff + (void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT); + unblock_autocmds(); + vim_free(cmd); + return OK; } } @@ -1282,89 +1527,105 @@ ex_diffoff(exarg_T *eap) */ static void diff_read( - int idx_orig, /* idx of original file */ - int idx_new, /* idx of new file */ - char_u *fname) /* name of diff output file */ + int idx_orig, // idx of original file + int idx_new, // idx of new file + diffout_T *dout) // diff output { - FILE *fd; + FILE *fd = NULL; + int line_idx = 0; diff_T *dprev = NULL; diff_T *dp = curtab->tp_first_diff; diff_T *dn, *dpl; - long f1, l1, f2, l2; char_u linebuf[LBUFLEN]; /* only need to hold the diff line */ - int difftype; - char_u *p; + char_u *line; long off; int i; linenr_T lnum_orig, lnum_new; long count_orig, count_new; int notset = TRUE; /* block "*dp" not set yet */ + enum { + DIFF_ED, + DIFF_UNIFIED, + DIFF_NONE + } diffstyle = DIFF_NONE; - fd = mch_fopen((char *)fname, "r"); - if (fd == NULL) + if (dout->dout_fname == NULL) { - EMSG(_("E98: Cannot read diff output")); - return; + diffstyle = DIFF_UNIFIED; + } + else + { + fd = mch_fopen((char *)dout->dout_fname, "r"); + if (fd == NULL) + { + EMSG(_("E98: Cannot read diff output")); + return; + } } for (;;) { - if (tag_fgets(linebuf, LBUFLEN, fd)) - break; /* end of file */ - if (!isdigit(*linebuf)) - continue; /* not the start of a diff block */ - - /* This line must be one of three formats: - * {first}[,{last}]c{first}[,{last}] - * {first}a{first}[,{last}] - * {first}[,{last}]d{first} - */ - p = linebuf; - f1 = getdigits(&p); - if (*p == ',') + if (fd == NULL) { - ++p; - l1 = getdigits(&p); - } - else - l1 = f1; - if (*p != 'a' && *p != 'c' && *p != 'd') - continue; /* invalid diff format */ - difftype = *p++; - f2 = getdigits(&p); - if (*p == ',') - { - ++p; - l2 = getdigits(&p); - } - else - l2 = f2; - if (l1 < f1 || l2 < f2) - continue; /* invalid line range */ - - if (difftype == 'a') - { - lnum_orig = f1 + 1; - count_orig = 0; + if (line_idx >= dout->dout_ga.ga_len) + break; // did last line + line = ((char_u **)dout->dout_ga.ga_data)[line_idx++]; } else { - lnum_orig = f1; - count_orig = l1 - f1 + 1; - } - if (difftype == 'd') - { - lnum_new = f2 + 1; - count_new = 0; - } - else - { - lnum_new = f2; - count_new = l2 - f2 + 1; + if (tag_fgets(linebuf, LBUFLEN, fd)) + break; // end of file + line = linebuf; } - /* Go over blocks before the change, for which orig and new are equal. - * Copy blocks from orig to new. */ + if (diffstyle == DIFF_NONE) + { + // Determine diff style. + // ed like diff looks like this: + // {first}[,{last}]c{first}[,{last}] + // {first}a{first}[,{last}] + // {first}[,{last}]d{first} + // + // unified diff looks like this: + // --- file1 2018-03-20 13:23:35.783153140 +0100 + // +++ file2 2018-03-20 13:23:41.183156066 +0100 + // @@ -1,3 +1,5 @@ + if (isdigit(*line)) + diffstyle = DIFF_ED; + else if ((STRNCMP(line, "@@ ", 3) == 0)) + diffstyle = DIFF_UNIFIED; + else if ((STRNCMP(line, "--- ", 4) == 0) + && (tag_fgets(linebuf, LBUFLEN, fd) == 0) + && (STRNCMP(line, "+++ ", 4) == 0) + && (tag_fgets(linebuf, LBUFLEN, fd) == 0) + && (STRNCMP(line, "@@ ", 3) == 0)) + diffstyle = DIFF_UNIFIED; + } + + if (diffstyle == DIFF_ED) + { + if (!isdigit(*line)) + continue; // not the start of a diff block + if (parse_diff_ed(line, &lnum_orig, &count_orig, + &lnum_new, &count_new) == FAIL) + continue; + } + else if (diffstyle == DIFF_UNIFIED) + { + if (STRNCMP(line, "@@ ", 3) != 0) + continue; // not the start of a diff block + if (parse_diff_unified(line, &lnum_orig, &count_orig, + &lnum_new, &count_new) == FAIL) + continue; + } + else + { + EMSG(_("E959: Invalid diff format.")); + break; + } + + // Go over blocks before the change, for which orig and new are equal. + // Copy blocks from orig to new. while (dp != NULL && lnum_orig > dp->df_lnum[idx_orig] + dp->df_count[idx_orig]) { @@ -1379,14 +1640,14 @@ diff_read( && lnum_orig <= dp->df_lnum[idx_orig] + dp->df_count[idx_orig] && lnum_orig + count_orig >= dp->df_lnum[idx_orig]) { - /* New block overlaps with existing block(s). - * First find last block that overlaps. */ + // New block overlaps with existing block(s). + // First find last block that overlaps. for (dpl = dp; dpl->df_next != NULL; dpl = dpl->df_next) if (lnum_orig + count_orig < dpl->df_next->df_lnum[idx_orig]) break; - /* If the newly found block starts before the old one, set the - * start back a number of lines. */ + // If the newly found block starts before the old one, set the + // start back a number of lines. off = dp->df_lnum[idx_orig] - lnum_orig; if (off > 0) { @@ -1398,24 +1659,24 @@ diff_read( } else if (notset) { - /* new block inside existing one, adjust new block */ + // new block inside existing one, adjust new block dp->df_lnum[idx_new] = lnum_new + off; dp->df_count[idx_new] = count_new - off; } else - /* second overlap of new block with existing block */ + // second overlap of new block with existing block dp->df_count[idx_new] += count_new - count_orig + dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig] - (dp->df_lnum[idx_orig] + dp->df_count[idx_orig]); - /* Adjust the size of the block to include all the lines to the - * end of the existing block or the new diff, whatever ends last. */ + // Adjust the size of the block to include all the lines to the + // end of the existing block or the new diff, whatever ends last. off = (lnum_orig + count_orig) - (dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig]); if (off < 0) { - /* new change ends in existing block, adjust the end if not - * done already */ + // new change ends in existing block, adjust the end if not + // done already if (notset) dp->df_count[idx_new] += -off; off = 0; @@ -1425,7 +1686,7 @@ diff_read( dp->df_count[i] = dpl->df_lnum[i] + dpl->df_count[i] - dp->df_lnum[i] + off; - /* Delete the diff blocks that have been merged into one. */ + // Delete the diff blocks that have been merged into one. dn = dp->df_next; dp->df_next = dpl->df_next; while (dn != dp->df_next) @@ -1437,7 +1698,7 @@ diff_read( } else { - /* Allocate a new diffblock. */ + // Allocate a new diffblock. dp = diff_alloc_new(curtab, dprev, dp); if (dp == NULL) goto done; @@ -1447,17 +1708,17 @@ diff_read( dp->df_lnum[idx_new] = lnum_new; dp->df_count[idx_new] = count_new; - /* Set values for other buffers, these must be equal to the - * original buffer, otherwise there would have been a change - * already. */ + // Set values for other buffers, these must be equal to the + // original buffer, otherwise there would have been a change + // already. for (i = idx_orig + 1; i < idx_new; ++i) if (curtab->tp_diffbuf[i] != NULL) diff_copy_entry(dprev, dp, idx_orig, i); } - notset = FALSE; /* "*dp" has been set */ + notset = FALSE; // "*dp" has been set } - /* for remaining diff blocks orig and new are equal */ + // for remaining diff blocks orig and new are equal while (dp != NULL) { if (notset) @@ -1468,7 +1729,8 @@ diff_read( } done: - fclose(fd); + if (fd != NULL) + fclose(fd); } /* @@ -1860,6 +2122,7 @@ diffopt_changed(void) int diff_context_new = 6; int diff_flags_new = 0; int diff_foldcolumn_new = 2; + long diff_algorithm_new = 0; tabpage_T *tp; p = p_dip; @@ -1905,6 +2168,41 @@ diffopt_changed(void) p += 9; diff_flags_new |= DIFF_HIDDEN_OFF; } + else if (STRNCMP(p, "indent-heuristic", 16) == 0) + { + p += 16; + diff_algorithm_new |= XDF_INDENT_HEURISTIC; + } + else if (STRNCMP(p, "internal", 8) == 0) + { + p += 8; + diff_flags_new |= DIFF_INTERNAL; + } + else if (STRNCMP(p, "algorithm:", 10) == 0) + { + p += 10; + if (STRNCMP(p, "myers", 5) == 0) + { + p += 5; + diff_algorithm_new = 0; + } + else if (STRNCMP(p, "minimal", 7) == 0) + { + p += 7; + diff_algorithm_new = XDF_NEED_MINIMAL; + } + else if (STRNCMP(p, "patience", 8) == 0) + { + p += 8; + diff_algorithm_new = XDF_PATIENCE_DIFF; + } + else if (STRNCMP(p, "histogram", 9) == 0) + { + p += 9; + diff_algorithm_new = XDF_HISTOGRAM_DIFF; + } + } + if (*p != ',' && *p != NUL) return FAIL; if (*p == ',') @@ -1916,13 +2214,14 @@ diffopt_changed(void) return FAIL; /* If "icase" or "iwhite" was added or removed, need to update the diff. */ - if (diff_flags != diff_flags_new) + if (diff_flags != diff_flags_new || diff_algorithm != diff_algorithm_new) FOR_ALL_TABPAGES(tp) tp->tp_diff_invalid = TRUE; diff_flags = diff_flags_new; diff_context = diff_context_new; diff_foldcolumn = diff_foldcolumn_new; + diff_algorithm = diff_algorithm_new; diff_redraw(TRUE); @@ -2690,4 +2989,156 @@ diff_lnum_win(linenr_T lnum, win_T *wp) return n; } +/* + * Handle an ED style diff line. + * Return FAIL if the line does not contain diff info. + */ + static int +parse_diff_ed( + char_u *line, + linenr_T *lnum_orig, + long *count_orig, + linenr_T *lnum_new, + long *count_new) +{ + char_u *p; + long f1, l1, f2, l2; + int difftype; + + // The line must be one of three formats: + // change: {first}[,{last}]c{first}[,{last}] + // append: {first}a{first}[,{last}] + // delete: {first}[,{last}]d{first} + p = line; + f1 = getdigits(&p); + if (*p == ',') + { + ++p; + l1 = getdigits(&p); + } + else + l1 = f1; + if (*p != 'a' && *p != 'c' && *p != 'd') + return FAIL; // invalid diff format + difftype = *p++; + f2 = getdigits(&p); + if (*p == ',') + { + ++p; + l2 = getdigits(&p); + } + else + l2 = f2; + if (l1 < f1 || l2 < f2) + return FAIL; + + if (difftype == 'a') + { + *lnum_orig = f1 + 1; + *count_orig = 0; + } + else + { + *lnum_orig = f1; + *count_orig = l1 - f1 + 1; + } + if (difftype == 'd') + { + *lnum_new = f2 + 1; + *count_new = 0; + } + else + { + *lnum_new = f2; + *count_new = l2 - f2 + 1; + } + return OK; +} + +/* + * Parses unified diff with zero(!) context lines. + * Return FAIL if there is no diff information in "line". + */ + static int +parse_diff_unified( + char_u *line, + linenr_T *lnum_orig, + long *count_orig, + linenr_T *lnum_new, + long *count_new) +{ + char_u *p; + long oldline, oldcount, newline, newcount; + + // Parse unified diff hunk header: + // @@ -oldline,oldcount +newline,newcount @@ + p = line; + if (*p++ == '@' && *p++ == '@' && *p++ == ' ' && *p++ == '-') + { + oldline = getdigits(&p); + if (*p == ',') + { + ++p; + oldcount = getdigits(&p); + } + else + oldcount = 1; + if (*p++ == ' ' && *p++ == '+') + { + newline = getdigits(&p); + if (*p == ',') + { + ++p; + newcount = getdigits(&p); + } + else + newcount = 1; + } + else + return FAIL; // invalid diff format + + if (oldcount == 0) + oldline += 1; + if (newcount == 0) + newline += 1; + if (newline == 0) + newline = 1; + + *lnum_orig = oldline; + *count_orig = oldcount; + *lnum_new = newline; + *count_new = newcount; + + return OK; + } + + return FAIL; +} + +/* + * Callback function for the xdl_diff() function. + * Stores the diff output in a grow array. + */ + static int +xdiff_out(void *priv, mmbuffer_t *mb, int nbuf) +{ + diffout_T *dout = (diffout_T *)priv; + int i; + char_u *p; + + for (i = 0; i < nbuf; i++) + { + // We are only interested in the header lines, skip text lines. + if (STRNCMP(mb[i].ptr, "@@ ", 3) != 0) + continue; + if (ga_grow(&dout->dout_ga, 1) == FAIL) + return -1; + p = vim_strnsave((char_u *)mb[i].ptr, mb[i].size); + if (p == NULL) + return -1; + ((char_u **)dout->dout_ga.ga_data)[dout->dout_ga.ga_len++] = p; + } + return 0; +} + #endif /* FEAT_DIFF */ diff --git a/src/eval.c b/src/eval.c index 3a275213cb..358217a824 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1495,8 +1495,8 @@ list_vim_vars(int *first) static void list_script_vars(int *first) { - if (current_SID > 0 && current_SID <= ga_scripts.ga_len) - list_hashtable_vars(&SCRIPT_VARS(current_SID), + if (current_sctx.sc_sid > 0 && current_sctx.sc_sid <= ga_scripts.ga_len) + list_hashtable_vars(&SCRIPT_VARS(current_sctx.sc_sid), (char_u *)"s:", FALSE, first); } @@ -7202,7 +7202,7 @@ find_var_in_ht( /* Must be something like "s:", otherwise "ht" would be NULL. */ switch (htname) { - case 's': return &SCRIPT_SV(current_SID)->sv_var; + case 's': return &SCRIPT_SV(current_sctx.sc_sid)->sv_var; case 'g': return &globvars_var; case 'v': return &vimvars_var; case 'b': return &curbuf->b_bufvar; @@ -7286,8 +7286,8 @@ find_var_ht(char_u *name, char_u **varname) if (*name == 'l') /* l: local function variable */ return get_funccal_local_ht(); if (*name == 's' /* script variable */ - && current_SID > 0 && current_SID <= ga_scripts.ga_len) - return &SCRIPT_VARS(current_SID); + && current_sctx.sc_sid > 0 && current_sctx.sc_sid <= ga_scripts.ga_len) + return &SCRIPT_VARS(current_sctx.sc_sid); return NULL; } @@ -8729,20 +8729,25 @@ store_session_globals(FILE *fd) * Should only be invoked when 'verbose' is non-zero. */ void -last_set_msg(scid_T scriptID) +last_set_msg(sctx_T script_ctx) { char_u *p; - if (scriptID != 0) + if (script_ctx.sc_sid != 0) { - p = home_replace_save(NULL, get_scriptname(scriptID)); + p = home_replace_save(NULL, get_scriptname(script_ctx.sc_sid)); if (p != NULL) { verbose_enter(); MSG_PUTS(_("\n\tLast set from ")); MSG_PUTS(p); - vim_free(p); + if (script_ctx.sc_lnum > 0) + { + MSG_PUTS(_(" line ")); + msg_outnum((long)script_ctx.sc_lnum); + } verbose_leave(); + vim_free(p); } } } diff --git a/src/evalfunc.c b/src/evalfunc.c index c03bc3e210..cdcf3face0 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -4061,7 +4061,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) * also be called from another script. Using trans_function_name() * would also work, but some plugins depend on the name being * printable text. */ - sprintf(sid_buf, "%ld_", (long)current_SID); + sprintf(sid_buf, "%ld_", (long)current_sctx.sc_sid); name = alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1)); if (name != NULL) { @@ -7641,7 +7641,8 @@ get_maparg(typval_T *argvars, typval_T *rettv, int exact) dict_add_number(dict, "noremap", mp->m_noremap ? 1L : 0L); dict_add_number(dict, "expr", mp->m_expr ? 1L : 0L); dict_add_number(dict, "silent", mp->m_silent ? 1L : 0L); - dict_add_number(dict, "sid", (long)mp->m_script_ID); + dict_add_number(dict, "sid", (long)mp->m_script_ctx.sc_sid); + dict_add_number(dict, "lnum", (long)mp->m_script_ctx.sc_lnum); dict_add_number(dict, "buffer", (long)buffer_local); dict_add_number(dict, "nowait", mp->m_nowait ? 1L : 0L); dict_add_string(dict, "mode", mapmode); diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 53ff0b65ea..17329b7b2b 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1866,9 +1866,9 @@ script_prof_save( { scriptitem_T *si; - if (current_SID > 0 && current_SID <= script_items.ga_len) + if (current_sctx.sc_sid > 0 && current_sctx.sc_sid <= script_items.ga_len) { - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_prof_on && si->sn_pr_nest++ == 0) profile_start(&si->sn_pr_child); } @@ -1883,9 +1883,9 @@ script_prof_restore(proftime_T *tm) { scriptitem_T *si; - if (current_SID > 0 && current_SID <= script_items.ga_len) + if (current_sctx.sc_sid > 0 && current_sctx.sc_sid <= script_items.ga_len) { - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_prof_on && --si->sn_pr_nest == 0) { profile_end(&si->sn_pr_child); @@ -2003,8 +2003,8 @@ script_dump_profile(FILE *fd) int prof_def_func(void) { - if (current_SID > 0) - return SCRIPT_ITEM(current_SID).sn_pr_force; + if (current_sctx.sc_sid > 0) + return SCRIPT_ITEM(current_sctx.sc_sid).sn_pr_force; return FALSE; } @@ -3764,14 +3764,17 @@ source_all_matches(char_u *pat) add_pack_dir_to_rtp(char_u *fname) { char_u *p4, *p3, *p2, *p1, *p; - char_u *insp; + char_u *entry; + char_u *insp = NULL; int c; char_u *new_rtp; int keep; size_t oldlen; size_t addlen; + size_t new_rtp_len; char_u *afterdir = NULL; size_t afterlen = 0; + char_u *after_insp = NULL; char_u *ffname = NULL; size_t fname_len; char_u *buf = NULL; @@ -3798,54 +3801,99 @@ add_pack_dir_to_rtp(char_u *fname) if (ffname == NULL) return FAIL; - /* Find "ffname" in "p_rtp", ignoring '/' vs '\' differences. */ + // Find "ffname" in "p_rtp", ignoring '/' vs '\' differences. + // Also stop at the first "after" directory. fname_len = STRLEN(ffname); - insp = p_rtp; buf = alloc(MAXPATHL); if (buf == NULL) goto theend; - while (*insp != NUL) + for (entry = p_rtp; *entry != NUL; ) { - copy_option_part(&insp, buf, MAXPATHL, ","); - add_pathsep(buf); - rtp_ffname = fix_fname(buf); - if (rtp_ffname == NULL) - goto theend; - match = vim_fnamencmp(rtp_ffname, ffname, fname_len) == 0; - vim_free(rtp_ffname); - if (match) + char_u *cur_entry = entry; + + copy_option_part(&entry, buf, MAXPATHL, ","); + if (insp == NULL) + { + add_pathsep(buf); + rtp_ffname = fix_fname(buf); + if (rtp_ffname == NULL) + goto theend; + match = vim_fnamencmp(rtp_ffname, ffname, fname_len) == 0; + vim_free(rtp_ffname); + if (match) + // Insert "ffname" after this entry (and comma). + insp = entry; + } + + if ((p = (char_u *)strstr((char *)buf, "after")) != NULL + && p > buf + && vim_ispathsep(p[-1]) + && (vim_ispathsep(p[5]) || p[5] == NUL || p[5] == ',')) + { + if (insp == NULL) + // Did not find "ffname" before the first "after" directory, + // insert it before this entry. + insp = cur_entry; + after_insp = cur_entry; break; + } } - if (*insp == NUL) - /* not found, append at the end */ + if (insp == NULL) + // Both "fname" and "after" not found, append at the end. insp = p_rtp + STRLEN(p_rtp); - else - /* append after the matching directory. */ - --insp; - /* check if rtp/pack/name/start/name/after exists */ + // check if rtp/pack/name/start/name/after exists afterdir = concat_fnames(fname, (char_u *)"after", TRUE); if (afterdir != NULL && mch_isdir(afterdir)) - afterlen = STRLEN(afterdir) + 1; /* add one for comma */ + afterlen = STRLEN(afterdir) + 1; // add one for comma oldlen = STRLEN(p_rtp); - addlen = STRLEN(fname) + 1; /* add one for comma */ - new_rtp = alloc((int)(oldlen + addlen + afterlen + 1)); - /* add one for NUL */ + addlen = STRLEN(fname) + 1; // add one for comma + new_rtp = alloc((int)(oldlen + addlen + afterlen + 1)); // add one for NUL if (new_rtp == NULL) goto theend; + + // We now have 'rtp' parts: {keep}{keep_after}{rest}. + // Create new_rtp, first: {keep},{fname} keep = (int)(insp - p_rtp); mch_memmove(new_rtp, p_rtp, keep); - new_rtp[keep] = ','; - mch_memmove(new_rtp + keep + 1, fname, addlen); - if (p_rtp[keep] != NUL) - mch_memmove(new_rtp + keep + addlen, p_rtp + keep, oldlen - keep + 1); - if (afterlen > 0) + new_rtp_len = keep; + if (*insp == NUL) + new_rtp[new_rtp_len++] = ','; // add comma before + mch_memmove(new_rtp + new_rtp_len, fname, addlen - 1); + new_rtp_len += addlen - 1; + if (*insp != NUL) + new_rtp[new_rtp_len++] = ','; // add comma after + + if (afterlen > 0 && after_insp != NULL) { + int keep_after = (int)(after_insp - p_rtp); + + // Add to new_rtp: {keep},{fname}{keep_after},{afterdir} + mch_memmove(new_rtp + new_rtp_len, p_rtp + keep, + keep_after - keep); + new_rtp_len += keep_after - keep; + mch_memmove(new_rtp + new_rtp_len, afterdir, afterlen - 1); + new_rtp_len += afterlen - 1; + new_rtp[new_rtp_len++] = ','; + keep = keep_after; + } + + if (p_rtp[keep] != NUL) + // Append rest: {keep},{fname}{keep_after},{afterdir}{rest} + mch_memmove(new_rtp + new_rtp_len, p_rtp + keep, oldlen - keep + 1); + else + new_rtp[new_rtp_len] = NUL; + + if (afterlen > 0 && after_insp == NULL) + { + // Append afterdir when "after" was not found: + // {keep},{fname}{rest},{afterdir} STRCAT(new_rtp, ","); STRCAT(new_rtp, afterdir); } + set_option_value((char_u *)"rtp", 0L, new_rtp, 0); vim_free(new_rtp); retval = OK; @@ -4376,7 +4424,7 @@ do_source( char_u *firstline = NULL; int retval = FAIL; #ifdef FEAT_EVAL - scid_T save_current_SID; + sctx_T save_current_sctx; static scid_T last_current_SID = 0; void *save_funccalp; int save_debug_break_level = debug_break_level; @@ -4546,13 +4594,15 @@ do_source( * Check if this script was sourced before to finds its SID. * If it's new, generate a new SID. */ - save_current_SID = current_SID; + save_current_sctx = current_sctx; + current_sctx.sc_lnum = 0; # ifdef UNIX stat_ok = (mch_stat((char *)fname_exp, &st) >= 0); # endif - for (current_SID = script_items.ga_len; current_SID > 0; --current_SID) + for (current_sctx.sc_sid = script_items.ga_len; current_sctx.sc_sid > 0; + --current_sctx.sc_sid) { - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_name != NULL && ( # ifdef UNIX @@ -4566,13 +4616,13 @@ do_source( fnamecmp(si->sn_name, fname_exp) == 0)) break; } - if (current_SID == 0) + if (current_sctx.sc_sid == 0) { - current_SID = ++last_current_SID; - if (ga_grow(&script_items, (int)(current_SID - script_items.ga_len)) - == FAIL) + current_sctx.sc_sid = ++last_current_SID; + if (ga_grow(&script_items, + (int)(current_sctx.sc_sid - script_items.ga_len)) == FAIL) goto almosttheend; - while (script_items.ga_len < current_SID) + while (script_items.ga_len < current_sctx.sc_sid) { ++script_items.ga_len; SCRIPT_ITEM(script_items.ga_len).sn_name = NULL; @@ -4580,7 +4630,7 @@ do_source( SCRIPT_ITEM(script_items.ga_len).sn_prof_on = FALSE; # endif } - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); si->sn_name = fname_exp; fname_exp = NULL; # ifdef UNIX @@ -4595,7 +4645,7 @@ do_source( # endif /* Allocate the local script variables to use for this script. */ - new_script_vars(current_SID); + new_script_vars(current_sctx.sc_sid); } # ifdef FEAT_PROFILE @@ -4651,7 +4701,7 @@ do_source( if (do_profiling == PROF_YES) { /* Get "si" again, "script_items" may have been reallocated. */ - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_prof_on) { profile_end(&si->sn_pr_start); @@ -4696,7 +4746,7 @@ do_source( #ifdef FEAT_EVAL almosttheend: - current_SID = save_current_SID; + current_sctx = save_current_sctx; restore_funccal(save_funccalp); # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) @@ -5115,9 +5165,9 @@ script_line_start(void) scriptitem_T *si; sn_prl_T *pp; - if (current_SID <= 0 || current_SID > script_items.ga_len) + if (current_sctx.sc_sid <= 0 || current_sctx.sc_sid > script_items.ga_len) return; - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_prof_on && sourcing_lnum >= 1) { /* Grow the array before starting the timer, so that the time spent @@ -5150,9 +5200,9 @@ script_line_exec(void) { scriptitem_T *si; - if (current_SID <= 0 || current_SID > script_items.ga_len) + if (current_sctx.sc_sid <= 0 || current_sctx.sc_sid > script_items.ga_len) return; - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_prof_on && si->sn_prl_idx >= 0) si->sn_prl_execed = TRUE; } @@ -5166,9 +5216,9 @@ script_line_end(void) scriptitem_T *si; sn_prl_T *pp; - if (current_SID <= 0 || current_SID > script_items.ga_len) + if (current_sctx.sc_sid <= 0 || current_sctx.sc_sid > script_items.ga_len) return; - si = &SCRIPT_ITEM(current_SID); + si = &SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_prof_on && si->sn_prl_idx >= 0 && si->sn_prl_idx < si->sn_prl_ga.ga_len) { diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 1cde89043e..79d65696d5 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -29,7 +29,7 @@ typedef struct ucmd int uc_compl; /* completion type */ int uc_addr_type; /* The command's address type */ # ifdef FEAT_EVAL - scid_T uc_scriptID; /* SID where the command was defined */ + sctx_T uc_script_ctx; /* SCTX where the command was defined */ # ifdef FEAT_CMDL_COMPL char_u *uc_compl_arg; /* completion argument if any */ # endif @@ -3347,7 +3347,8 @@ find_ucmd( if (xp != NULL) { xp->xp_arg = uc->uc_compl_arg; - xp->xp_scriptID = uc->uc_scriptID; + xp->xp_script_ctx = uc->uc_script_ctx; + xp->xp_script_ctx.sc_lnum += sourcing_lnum; } # endif # endif @@ -5936,7 +5937,8 @@ uc_add_command( cmd->uc_def = def; cmd->uc_compl = compl; #ifdef FEAT_EVAL - cmd->uc_scriptID = current_SID; + cmd->uc_script_ctx = current_sctx; + cmd->uc_script_ctx.sc_lnum += sourcing_lnum; # ifdef FEAT_CMDL_COMPL cmd->uc_compl_arg = compl_arg; # endif @@ -6157,7 +6159,7 @@ uc_list(char_u *name, size_t name_len) msg_outtrans_special(cmd->uc_rep, FALSE); #ifdef FEAT_EVAL if (p_verbose > 0) - last_set_msg(cmd->uc_scriptID); + last_set_msg(cmd->uc_script_ctx); #endif out_flush(); ui_breakcheck(); @@ -6922,7 +6924,7 @@ do_ucmd(exarg_T *eap) char_u *split_buf = NULL; ucmd_T *cmd; #ifdef FEAT_EVAL - scid_T save_current_SID = current_SID; + sctx_T save_current_sctx = current_sctx; #endif if (eap->cmdidx == CMD_USER) @@ -7023,12 +7025,12 @@ do_ucmd(exarg_T *eap) } #ifdef FEAT_EVAL - current_SID = cmd->uc_scriptID; + current_sctx.sc_sid = cmd->uc_script_ctx.sc_sid; #endif (void)do_cmdline(buf, eap->getline, eap->cookie, DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED); #ifdef FEAT_EVAL - current_SID = save_current_SID; + current_sctx = save_current_sctx; #endif vim_free(buf); vim_free(split_buf); @@ -10762,14 +10764,16 @@ find_cmdline_var(char_u *src, int *usedlen) "", /* ":so" file line number */ #define SPEC_SLNUM (SPEC_SFILE + 1) "", /* autocommand file name */ -#define SPEC_AFILE (SPEC_SLNUM + 1) +#define SPEC_AFILE (SPEC_SLNUM + 1) "", /* autocommand buffer number */ -#define SPEC_ABUF (SPEC_AFILE + 1) +#define SPEC_ABUF (SPEC_AFILE + 1) "", /* autocommand match name */ #define SPEC_AMATCH (SPEC_ABUF + 1) + "", /* script file line number */ +#define SPEC_SFLNUM (SPEC_AMATCH + 1) #ifdef FEAT_CLIENTSERVER "" -# define SPEC_CLIENT (SPEC_AMATCH + 1) +# define SPEC_CLIENT (SPEC_SFLNUM + 1) #endif }; @@ -11025,6 +11029,7 @@ eval_vars( return NULL; } break; + case SPEC_SLNUM: /* line in file for ":so" command */ if (sourcing_name == NULL || sourcing_lnum == 0) { @@ -11034,13 +11039,28 @@ eval_vars( sprintf((char *)strbuf, "%ld", (long)sourcing_lnum); result = strbuf; break; -#if defined(FEAT_CLIENTSERVER) + +#ifdef FEAT_EVAL + case SPEC_SFLNUM: /* line in script file */ + if (current_sctx.sc_lnum + sourcing_lnum == 0) + { + *errormsg = (char_u *)_("E961: no line number to use for \"\""); + return NULL; + } + sprintf((char *)strbuf, "%ld", + (long)(current_sctx.sc_lnum + sourcing_lnum)); + result = strbuf; + break; +#endif + +#ifdef FEAT_CLIENTSERVER case SPEC_CLIENT: /* Source of last submitted input */ sprintf((char *)strbuf, PRINTF_HEX_LONG_U, (long_u)clientWindow); result = strbuf; break; #endif + default: result = (char_u *)""; /* avoid gcc warning */ break; diff --git a/src/ex_getln.c b/src/ex_getln.c index 079684c492..47d270f798 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -462,7 +462,7 @@ may_do_incsearch_highlighting( incsearch_state_T *is_state) { int skiplen, patlen; - int i; + int found; // do_search() result pos_T end_pos; struct cmdline_info save_ccline; #ifdef FEAT_RELTIME @@ -508,7 +508,7 @@ may_do_incsearch_highlighting( // If there is no pattern, don't do anything. if (patlen == 0 && !use_last_pat) { - i = 0; + found = 0; set_no_hlsearch(TRUE); // turn off previous highlight redraw_all_later(SOME_VALID); } @@ -528,7 +528,7 @@ may_do_incsearch_highlighting( if (search_first_line != 0) search_flags += SEARCH_START; ccline.cmdbuff[skiplen + patlen] = NUL; - i = do_search(NULL, firstc == ':' ? '/' : firstc, + found = do_search(NULL, firstc == ':' ? '/' : firstc, ccline.cmdbuff + skiplen, count, search_flags, #ifdef FEAT_RELTIME &tm, NULL @@ -543,7 +543,7 @@ may_do_incsearch_highlighting( || curwin->w_cursor.lnum > search_last_line) { // match outside of address range - i = 0; + found = 0; curwin->w_cursor = is_state->search_start; } @@ -552,13 +552,13 @@ may_do_incsearch_highlighting( { (void)vpeekc(); // remove from input stream got_int = FALSE; // don't abandon the command line - i = 0; + found = 0; } else if (char_avail()) // cancelled searching because a char was typed is_state->incsearch_postponed = TRUE; } - if (i != 0) + if (found != 0) highlight_match = TRUE; // highlight position else highlight_match = FALSE; // remove highlight @@ -569,7 +569,7 @@ may_do_incsearch_highlighting( changed_cline_bef_curs(); update_topline(); - if (i != 0) + if (found != 0) { pos_T save_pos = curwin->w_cursor; @@ -604,8 +604,11 @@ may_do_incsearch_highlighting( restore_cmdline(&save_ccline); restore_last_search_pattern(); - // Leave it at the end to make CTRL-R CTRL-W work. - if (i != 0) + // Leave it at the end to make CTRL-R CTRL-W work. But not when beyond the + // end of the pattern, e.g. for ":s/pat/". + if (ccline.cmdbuff[skiplen + patlen] != NUL) + curwin->w_cursor = is_state->search_start; + else if (found != 0) curwin->w_cursor = end_pos; msg_starthere(); @@ -5603,7 +5606,7 @@ call_user_expand_func( { int keep = 0; typval_T args[4]; - int save_current_SID = current_SID; + sctx_T save_current_sctx = current_sctx; char_u *pat = NULL; void *ret; struct cmdline_info save_ccline; @@ -5633,12 +5636,12 @@ call_user_expand_func( save_ccline = ccline; ccline.cmdbuff = NULL; ccline.cmdprompt = NULL; - current_SID = xp->xp_scriptID; + current_sctx = xp->xp_script_ctx; ret = user_expand_func(xp->xp_arg, 3, args); ccline = save_ccline; - current_SID = save_current_SID; + current_sctx = save_current_sctx; if (ccline.cmdbuff != NULL) ccline.cmdbuff[ccline.cmdlen] = keep; diff --git a/src/fileio.c b/src/fileio.c index 3401865f52..75a2a4d5bc 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -7738,7 +7738,7 @@ typedef struct AutoCmd char nested; /* If autocommands nest here */ char last; /* last command in list */ #ifdef FEAT_EVAL - scid_T scriptID; /* script ID where defined */ + sctx_T script_ctx; /* script context where defined */ #endif struct AutoCmd *next; /* Next AutoCmd in list */ } AutoCmd; @@ -8000,7 +8000,7 @@ show_autocmd(AutoPat *ap, event_T event) msg_outtrans(ac->cmd); #ifdef FEAT_EVAL if (p_verbose > 0) - last_set_msg(ac->scriptID); + last_set_msg(ac->script_ctx); #endif if (got_int) return; @@ -8883,7 +8883,8 @@ do_autocmd_event( return FAIL; ac->cmd = vim_strsave(cmd); #ifdef FEAT_EVAL - ac->scriptID = current_SID; + ac->script_ctx = current_sctx; + ac->script_ctx.sc_lnum += sourcing_lnum; #endif if (ac->cmd == NULL) { @@ -9450,7 +9451,7 @@ apply_autocmds_group( AutoPatCmd patcmd; AutoPat *ap; #ifdef FEAT_EVAL - scid_T save_current_SID; + sctx_T save_current_sctx; void *save_funccalp; char_u *save_cmdarg; long save_cmdbang; @@ -9659,7 +9660,7 @@ apply_autocmds_group( sourcing_lnum = 0; /* no line number here */ #ifdef FEAT_EVAL - save_current_SID = current_SID; + save_current_sctx = current_sctx; # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) @@ -9763,7 +9764,7 @@ apply_autocmds_group( autocmd_bufnr = save_autocmd_bufnr; autocmd_match = save_autocmd_match; #ifdef FEAT_EVAL - current_SID = save_current_SID; + current_sctx = save_current_sctx; restore_funccal(save_funccalp); # ifdef FEAT_PROFILE if (do_profiling == PROF_YES) @@ -9987,7 +9988,7 @@ getnextac(int c UNUSED, void *cookie, int indent UNUSED) retval = vim_strsave(ac->cmd); autocmd_nested = ac->nested; #ifdef FEAT_EVAL - current_SID = ac->scriptID; + current_sctx = ac->script_ctx; #endif if (ac->last) acp->nextcmd = NULL; diff --git a/src/getchar.c b/src/getchar.c index 8e39fabefd..2fda499b2d 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3677,7 +3677,8 @@ do_map( mp->m_mode = mode; #ifdef FEAT_EVAL mp->m_expr = expr; - mp->m_script_ID = current_SID; + mp->m_script_ctx = current_sctx; + mp->m_script_ctx.sc_lnum += sourcing_lnum; #endif did_it = TRUE; } @@ -3783,7 +3784,8 @@ do_map( mp->m_mode = mode; #ifdef FEAT_EVAL mp->m_expr = expr; - mp->m_script_ID = current_SID; + mp->m_script_ctx = current_sctx; + mp->m_script_ctx.sc_lnum += sourcing_lnum; #endif /* add the new entry in front of the abbrlist or maphash[] list */ @@ -4097,7 +4099,7 @@ showmap( } #ifdef FEAT_EVAL if (p_verbose > 0) - last_set_msg(mp->m_script_ID); + last_set_msg(mp->m_script_ctx); #endif out_flush(); /* show one line at a time */ } diff --git a/src/globals.h b/src/globals.h index ca199792b4..27035465c4 100644 --- a/src/globals.h +++ b/src/globals.h @@ -325,8 +325,8 @@ EXTERN int may_garbage_collect INIT(= FALSE); EXTERN int want_garbage_collect INIT(= FALSE); EXTERN int garbage_collect_at_exit INIT(= FALSE); -/* ID of script being sourced or was sourced to define the current function. */ -EXTERN scid_T current_SID INIT(= 0); +// Script CTX being sourced or was sourced to define the current function. +EXTERN sctx_T current_sctx INIT(= {0 COMMA 0}); #endif EXTERN int did_source_packages INIT(= FALSE); diff --git a/src/main.c b/src/main.c index e9781b1149..6ca588be9e 100644 --- a/src/main.c +++ b/src/main.c @@ -2996,13 +2996,13 @@ exe_pre_commands(mparm_T *parmp) curwin->w_cursor.lnum = 0; /* just in case.. */ sourcing_name = (char_u *)_("pre-vimrc command line"); # ifdef FEAT_EVAL - current_SID = SID_CMDARG; + current_sctx.sc_sid = SID_CMDARG; # endif for (i = 0; i < cnt; ++i) do_cmdline_cmd(cmds[i]); sourcing_name = NULL; # ifdef FEAT_EVAL - current_SID = 0; + current_sctx.sc_sid = 0; # endif TIME_MSG("--cmd commands"); } @@ -3026,7 +3026,7 @@ exe_commands(mparm_T *parmp) curwin->w_cursor.lnum = 0; sourcing_name = (char_u *)"command line"; #ifdef FEAT_EVAL - current_SID = SID_CARG; + current_sctx.sc_sid = SID_CARG; #endif for (i = 0; i < parmp->n_commands; ++i) { @@ -3036,7 +3036,7 @@ exe_commands(mparm_T *parmp) } sourcing_name = NULL; #ifdef FEAT_EVAL - current_SID = 0; + current_sctx.sc_sid = 0; #endif if (curwin->w_cursor.lnum == 0) curwin->w_cursor.lnum = 1; @@ -3243,7 +3243,7 @@ process_env( char_u *save_sourcing_name; linenr_T save_sourcing_lnum; #ifdef FEAT_EVAL - scid_T save_sid; + sctx_T save_current_sctx; #endif if ((initstr = mch_getenv(env)) != NULL && *initstr != NUL) @@ -3255,14 +3255,15 @@ process_env( sourcing_name = env; sourcing_lnum = 0; #ifdef FEAT_EVAL - save_sid = current_SID; - current_SID = SID_ENV; + save_current_sctx = current_sctx; + current_sctx.sc_sid = SID_ENV; + current_sctx.sc_lnum = 0; #endif do_cmdline_cmd(initstr); sourcing_name = save_sourcing_name; sourcing_lnum = save_sourcing_lnum; #ifdef FEAT_EVAL - current_SID = save_sid; + current_sctx = save_current_sctx; #endif return OK; } diff --git a/src/menu.c b/src/menu.c index 9656721d4d..5654b58e78 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2272,7 +2272,7 @@ execute_menu(exarg_T *eap, vimmenu_T *menu) /* Use the Insert mode entry when returning to Insert mode. */ if (restart_edit #ifdef FEAT_EVAL - && !current_SID + && !current_sctx.sc_sid #endif ) { @@ -2348,7 +2348,7 @@ execute_menu(exarg_T *eap, vimmenu_T *menu) * Otherwise put them in the typeahead buffer. */ if (eap == NULL #ifdef FEAT_EVAL - || current_SID != 0 + || current_sctx.sc_sid != 0 #endif ) { diff --git a/src/misc1.c b/src/misc1.c index 734728a9db..3caad149a5 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -4723,6 +4723,25 @@ get_env_name( # endif } +/* + * Add a user name to the list of users in ga_users. + * Do nothing if user name is NULL or empty. + */ + static void +add_user(char_u *user, int need_copy) +{ + char_u *user_copy = (user != NULL && need_copy) + ? vim_strsave(user) : user; + + if (user_copy == NULL || *user_copy == NUL || ga_grow(&ga_users, 1) == FAIL) + { + if (need_copy) + vim_free(user); + return; + } + ((char_u **)(ga_users.ga_data))[ga_users.ga_len++] = user_copy; +} + /* * Find all user names for user completion. * Done only once and then cached. @@ -4740,26 +4759,15 @@ init_users(void) # if defined(HAVE_GETPWENT) && defined(HAVE_PWD_H) { - char_u* user; struct passwd* pw; setpwent(); while ((pw = getpwent()) != NULL) - /* pw->pw_name shouldn't be NULL but just in case... */ - if (pw->pw_name != NULL) - { - if (ga_grow(&ga_users, 1) == FAIL) - break; - user = vim_strsave((char_u*)pw->pw_name); - if (user == NULL) - break; - ((char_u **)(ga_users.ga_data))[ga_users.ga_len++] = user; - } + add_user((char_u *)pw->pw_name, TRUE); endpwent(); } # elif defined(WIN3264) { - char_u* user; DWORD nusers = 0, ntotal = 0, i; PUSER_INFO_0 uinfo; @@ -4767,19 +4775,44 @@ init_users(void) &nusers, &ntotal, NULL) == NERR_Success) { for (i = 0; i < nusers; i++) - { - if (ga_grow(&ga_users, 1) == FAIL) - break; - user = utf16_to_enc(uinfo[i].usri0_name, NULL); - if (user == NULL) - break; - ((char_u **)(ga_users.ga_data))[ga_users.ga_len++] = user; - } + add_user(utf16_to_enc(uinfo[i].usri0_name, NULL), FALSE); NetApiBufferFree(uinfo); } } # endif +# if defined(HAVE_GETPWNAM) + { + char_u *user_env = mch_getenv((char_u *)"USER"); + + // The $USER environment variable may be a valid remote user name (NIS, + // LDAP) not already listed by getpwent(), as getpwent() only lists + // local user names. If $USER is not already listed, check whether it + // is a valid remote user name using getpwnam() and if it is, add it to + // the list of user names. + + if (user_env != NULL && *user_env != NUL) + { + int i; + + for (i = 0; i < ga_users.ga_len; i++) + { + char_u *local_user = ((char_u **)ga_users.ga_data)[i]; + + if (STRCMP(local_user, user_env) == 0) + break; + } + + if (i == ga_users.ga_len) + { + struct passwd *pw = getpwnam((char *)user_env); + + if (pw != NULL) + add_user((char_u *)pw->pw_name, TRUE); + } + } + } +# endif } /* diff --git a/src/option.c b/src/option.c index 16a160e4e4..737d31781b 100644 --- a/src/option.c +++ b/src/option.c @@ -410,20 +410,20 @@ static char_u *p_vsts_nopaste; struct vimoption { - char *fullname; /* full option name */ - char *shortname; /* permissible abbreviation */ - long_u flags; /* see below */ - char_u *var; /* global option: pointer to variable; - * window-local option: VAR_WIN; - * buffer-local option: global value */ - idopt_T indir; /* global option: PV_NONE; - * local option: indirect option index */ - char_u *def_val[2]; /* default values for variable (vi and vim) */ + char *fullname; // full option name + char *shortname; // permissible abbreviation + long_u flags; // see below + char_u *var; // global option: pointer to variable; + // window-local option: VAR_WIN; + // buffer-local option: global value + idopt_T indir; // global option: PV_NONE; + // local option: indirect option index + char_u *def_val[2]; // default values for variable (vi and vim) #ifdef FEAT_EVAL - scid_T scriptID; /* script in which the option was last set */ -# define SCRIPTID_INIT , 0 + sctx_T script_ctx; // script context where the option was last set +# define SCTX_INIT , {0, 0} #else -# define SCRIPTID_INIT +# define SCTX_INIT #endif }; @@ -521,7 +521,7 @@ static struct vimoption options[] = #else (char_u *)224L, #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"antialias", "anti", P_BOOL|P_VI_DEF|P_VIM|P_RCLR, #ifdef FEAT_ANTIALIAS (char_u *)&p_antialias, PV_NONE, @@ -533,35 +533,35 @@ static struct vimoption options[] = #else {(char_u *)FALSE, (char_u *)FALSE} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"arabic", "arab", P_BOOL|P_VI_DEF|P_VIM|P_CURSWANT, #ifdef FEAT_ARABIC (char_u *)VAR_WIN, PV_ARAB, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"arabicshape", "arshape", P_BOOL|P_VI_DEF|P_VIM|P_RCLR, #ifdef FEAT_ARABIC (char_u *)&p_arshape, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"allowrevins", "ari", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_RIGHTLEFT (char_u *)&p_ari, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"altkeymap", "akm", P_BOOL|P_VI_DEF, #ifdef FEAT_FKMAP (char_u *)&p_altkeymap, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"ambiwidth", "ambw", P_STRING|P_VI_DEF|P_RCLR, #if defined(FEAT_MBYTE) (char_u *)&p_ambw, PV_NONE, @@ -570,7 +570,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"autochdir", "acd", P_BOOL|P_VI_DEF, #ifdef FEAT_AUTOCHDIR (char_u *)&p_acd, PV_NONE, @@ -579,22 +579,22 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"autoindent", "ai", P_BOOL|P_VI_DEF, (char_u *)&p_ai, PV_AI, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"autoprint", "ap", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"autoread", "ar", P_BOOL|P_VI_DEF, (char_u *)&p_ar, PV_AR, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"autowrite", "aw", P_BOOL|P_VI_DEF, (char_u *)&p_aw, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"autowriteall","awa", P_BOOL|P_VI_DEF, (char_u *)&p_awa, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"background", "bg", P_STRING|P_VI_DEF|P_RCLR, (char_u *)&p_bg, PV_NONE, { @@ -603,13 +603,13 @@ static struct vimoption options[] = #else (char_u *)"light", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"backspace", "bs", P_STRING|P_VI_DEF|P_VIM|P_ONECOMMA|P_NODUP, (char_u *)&p_bs, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"backup", "bk", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_bk, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"backupcopy", "bkc", P_STRING|P_VIM|P_ONECOMMA|P_NODUP, (char_u *)&p_bkc, PV_BKC, #ifdef UNIX @@ -617,11 +617,11 @@ static struct vimoption options[] = #else {(char_u *)"auto", (char_u *)"auto"} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"backupdir", "bdir", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA |P_NODUP|P_SECURE, (char_u *)&p_bdir, PV_NONE, - {(char_u *)DFLT_BDIR, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)DFLT_BDIR, (char_u *)0L} SCTX_INIT}, {"backupext", "bex", P_STRING|P_VI_DEF|P_NFNAME, (char_u *)&p_bex, PV_NONE, { @@ -630,7 +630,7 @@ static struct vimoption options[] = #else (char_u *)"~", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"backupskip", "bsk", P_STRING|P_VI_DEF|P_ONECOMMA, #ifdef FEAT_WILDIGN (char_u *)&p_bsk, PV_NONE, @@ -639,7 +639,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"balloondelay","bdlay",P_NUM|P_VI_DEF, #ifdef FEAT_BEVAL (char_u *)&p_bdlay, PV_NONE, @@ -648,7 +648,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"ballooneval", "beval",P_BOOL|P_VI_DEF|P_NO_MKRC, #ifdef FEAT_BEVAL_GUI (char_u *)&p_beval, PV_NONE, @@ -657,7 +657,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"balloonevalterm", "bevalterm",P_BOOL|P_VI_DEF|P_NO_MKRC, #ifdef FEAT_BEVAL_TERM (char_u *)&p_bevalterm, PV_NONE, @@ -666,7 +666,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"balloonexpr", "bexpr", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM, #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) (char_u *)&p_bexpr, PV_BEXPR, @@ -675,19 +675,19 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"beautify", "bf", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"belloff", "bo", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_bo, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"binary", "bin", P_BOOL|P_VI_DEF|P_RSTAT, (char_u *)&p_bin, PV_BIN, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"bioskey", "biosk",P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"blurradius", "blur", P_NUM|P_VIM, #ifdef FEAT_GUI_MACVIM (char_u *)&p_blur, PV_NONE, @@ -701,7 +701,7 @@ static struct vimoption options[] = #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"breakat", "brk", P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST, #ifdef FEAT_LINEBREAK (char_u *)&p_breakat, PV_NONE, @@ -710,7 +710,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"breakindent", "bri", P_BOOL|P_VI_DEF|P_VIM|P_RWIN, #ifdef FEAT_LINEBREAK (char_u *)VAR_WIN, PV_BRI, @@ -719,7 +719,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"breakindentopt", "briopt", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF |P_ONECOMMA|P_NODUP, #ifdef FEAT_LINEBREAK @@ -729,7 +729,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)NULL} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"browsedir", "bsdir",P_STRING|P_VI_DEF, #ifdef FEAT_BROWSE (char_u *)&p_bsdir, PV_NONE, @@ -738,19 +738,19 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"bufhidden", "bh", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, (char_u *)&p_bh, PV_BH, {(char_u *)"", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"buflisted", "bl", P_BOOL|P_VI_DEF|P_NOGLOB, (char_u *)&p_bl, PV_BL, {(char_u *)1L, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"buftype", "bt", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB, (char_u *)&p_bt, PV_BT, {(char_u *)"", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"casemap", "cmp", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_MBYTE (char_u *)&p_cmp, PV_NONE, @@ -759,7 +759,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cdpath", "cd", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP, #ifdef FEAT_SEARCHPATH (char_u *)&p_cdpath, PV_NONE, @@ -768,7 +768,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cedit", NULL, P_STRING, #ifdef FEAT_CMDWIN (char_u *)&p_cedit, PV_NONE, @@ -777,7 +777,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"charconvert", "ccv", P_STRING|P_VI_DEF|P_SECURE, #if defined(FEAT_MBYTE) && defined(FEAT_EVAL) (char_u *)&p_ccv, PV_NONE, @@ -786,14 +786,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cindent", "cin", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_CINDENT (char_u *)&p_cin, PV_CIN, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"cinkeys", "cink", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_CINDENT (char_u *)&p_cink, PV_CINK, @@ -802,14 +802,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cinoptions", "cino", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_CINDENT (char_u *)&p_cino, PV_CINO, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"cinwords", "cinw", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) (char_u *)&p_cinw, PV_CINW, @@ -819,7 +819,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"clipboard", "cb", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_CLIPBOARD (char_u *)&p_cb, PV_NONE, @@ -833,34 +833,34 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cmdheight", "ch", P_NUM|P_VI_DEF|P_RALL, (char_u *)&p_ch, PV_NONE, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} SCTX_INIT}, {"cmdwinheight", "cwh", P_NUM|P_VI_DEF, #ifdef FEAT_CMDWIN (char_u *)&p_cwh, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)7L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)7L, (char_u *)0L} SCTX_INIT}, {"colorcolumn", "cc", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_RWIN, #ifdef FEAT_SYN_HL (char_u *)VAR_WIN, PV_CC, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR, (char_u *)&Columns, PV_NONE, - {(char_u *)80L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)80L, (char_u *)0L} SCTX_INIT}, {"columnspace", "csp", P_NUM|P_VI_DEF|P_RCLR, #ifdef FEAT_GUI_MACVIM (char_u *)&p_columnspace, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA |P_NODUP|P_CURSWANT, #ifdef FEAT_COMMENTS @@ -871,7 +871,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT, #ifdef FEAT_FOLDING (char_u *)&p_cms, PV_CMS, @@ -880,12 +880,12 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, /* P_PRI_MKRC isn't needed here, optval_default() * always returns TRUE for 'compatible' */ {"compatible", "cp", P_BOOL|P_RALL, (char_u *)&p_cp, PV_NONE, - {(char_u *)TRUE, (char_u *)FALSE} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)FALSE} SCTX_INIT}, {"complete", "cpt", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_INS_EXPAND (char_u *)&p_cpt, PV_CPT, @@ -894,7 +894,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"concealcursor","cocu", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, #ifdef FEAT_CONCEAL (char_u *)VAR_WIN, PV_COCU, @@ -903,7 +903,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"conceallevel","cole", P_NUM|P_RWIN|P_VI_DEF, #ifdef FEAT_CONCEAL (char_u *)VAR_WIN, PV_COLE, @@ -911,7 +911,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, #endif {(char_u *)0L, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"completefunc", "cfu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE, #ifdef FEAT_COMPL_FUNC (char_u *)&p_cfu, PV_CFU, @@ -920,7 +920,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"completeopt", "cot", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_INS_EXPAND (char_u *)&p_cot, PV_NONE, @@ -929,24 +929,24 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"confirm", "cf", P_BOOL|P_VI_DEF, #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) (char_u *)&p_confirm, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"conskey", "consk",P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"copyindent", "ci", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_ci, PV_CI, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"cpoptions", "cpo", P_STRING|P_VIM|P_RALL|P_FLAGLIST, (char_u *)&p_cpo, PV_NONE, {(char_u *)CPO_VI, (char_u *)CPO_VIM} - SCRIPTID_INIT}, + SCTX_INIT}, {"cryptmethod", "cm", P_STRING|P_ALLOCED|P_VI_DEF, #ifdef FEAT_CRYPT (char_u *)&p_cm, PV_CM, @@ -955,14 +955,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cscopepathcomp", "cspc", P_NUM|P_VI_DEF|P_VIM, #ifdef FEAT_CSCOPE (char_u *)&p_cspc, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"cscopeprg", "csprg", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #ifdef FEAT_CSCOPE (char_u *)&p_csprg, PV_NONE, @@ -971,7 +971,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cscopequickfix", "csqf", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #if defined(FEAT_CSCOPE) && defined(FEAT_QUICKFIX) (char_u *)&p_csqf, PV_NONE, @@ -980,55 +980,55 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"cscoperelative", "csre", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_CSCOPE (char_u *)&p_csre, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"cscopetag", "cst", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_CSCOPE (char_u *)&p_cst, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"cscopetagorder", "csto", P_NUM|P_VI_DEF|P_VIM, #ifdef FEAT_CSCOPE (char_u *)&p_csto, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"cscopeverbose", "csverb", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_CSCOPE (char_u *)&p_csverbose, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"cursorbind", "crb", P_BOOL|P_VI_DEF, (char_u *)VAR_WIN, PV_CRBIND, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_SYN_HL (char_u *)VAR_WIN, PV_CUC, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWINONLY, #ifdef FEAT_SYN_HL (char_u *)VAR_WIN, PV_CUL, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"debug", NULL, P_STRING|P_VI_DEF, (char_u *)&p_debug, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"define", "def", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT, #ifdef FEAT_FIND_ID (char_u *)&p_def, PV_DEF, @@ -1037,28 +1037,28 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"delcombine", "deco", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_MBYTE (char_u *)&p_deco, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"dictionary", "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME, #ifdef FEAT_INS_EXPAND (char_u *)&p_dict, PV_DICT, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"diff", NULL, P_BOOL|P_VI_DEF|P_RWIN|P_NOGLOB, #ifdef FEAT_DIFF (char_u *)VAR_WIN, PV_DIFF, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"diffexpr", "dex", P_STRING|P_VI_DEF|P_SECURE|P_CURSWANT, #if defined(FEAT_DIFF) && defined(FEAT_EVAL) (char_u *)&p_dex, PV_NONE, @@ -1067,38 +1067,38 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"diffopt", "dip", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN|P_ONECOMMA |P_NODUP, #ifdef FEAT_DIFF (char_u *)&p_dip, PV_NONE, - {(char_u *)"filler", (char_u *)NULL} + {(char_u *)"internal,filler", (char_u *)NULL} #else (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)NULL} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"digraph", "dg", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_DIGRAPHS (char_u *)&p_dg, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"directory", "dir", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA |P_NODUP|P_SECURE, (char_u *)&p_dir, PV_NONE, - {(char_u *)DFLT_DIR, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)DFLT_DIR, (char_u *)0L} SCTX_INIT}, {"display", "dy", P_STRING|P_VI_DEF|P_ONECOMMA|P_RALL|P_NODUP, (char_u *)&p_dy, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"eadirection", "ead", P_STRING|P_VI_DEF, (char_u *)&p_ead, PV_NONE, {(char_u *)"both", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"edcompatible","ed", P_BOOL|P_VI_DEF, (char_u *)&p_ed, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"emoji", "emo", P_BOOL|P_VI_DEF|P_RCLR, #if defined(FEAT_MBYTE) (char_u *)&p_emoji, PV_NONE, @@ -1107,7 +1107,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"encoding", "enc", P_STRING|P_VI_DEF|P_RCLR|P_NO_ML, #ifdef FEAT_MBYTE (char_u *)&p_enc, PV_NONE, @@ -1116,19 +1116,19 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"endofline", "eol", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT, (char_u *)&p_eol, PV_EOL, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"equalalways", "ea", P_BOOL|P_VI_DEF|P_RALL, (char_u *)&p_ea, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"equalprg", "ep", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_ep, PV_EP, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"errorbells", "eb", P_BOOL|P_VI_DEF, (char_u *)&p_eb, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"errorfile", "ef", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #ifdef FEAT_QUICKFIX (char_u *)&p_ef, PV_NONE, @@ -1137,7 +1137,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"errorformat", "efm", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_QUICKFIX (char_u *)&p_efm, PV_EFM, @@ -1146,19 +1146,19 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"esckeys", "ek", P_BOOL|P_VIM, (char_u *)&p_ek, PV_NONE, - {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, {"eventignore", "ei", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_ei, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"expandtab", "et", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_et, PV_ET, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"exrc", "ex", P_BOOL|P_VI_DEF|P_SECURE, (char_u *)&p_exrc, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"fileencoding","fenc", P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_RBUF |P_NO_MKRC, #ifdef FEAT_MBYTE @@ -1168,7 +1168,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"fileencodings","fencs", P_STRING|P_VI_DEF|P_ONECOMMA, #ifdef FEAT_MBYTE (char_u *)&p_fencs, PV_NONE, @@ -1177,15 +1177,15 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"fileformat", "ff", P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_NO_MKRC |P_CURSWANT, (char_u *)&p_ff, PV_FF, - {(char_u *)DFLT_FF, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)DFLT_FF, (char_u *)0L} SCTX_INIT}, {"fileformats", "ffs", P_STRING|P_VIM|P_ONECOMMA|P_NODUP, (char_u *)&p_ffs, PV_NONE, {(char_u *)DFLT_FFS_VI, (char_u *)DFLT_FFS_VIM} - SCRIPTID_INIT}, + SCTX_INIT}, {"fileignorecase", "fic", P_BOOL|P_VI_DEF, (char_u *)&p_fic, PV_NONE, { @@ -1194,28 +1194,28 @@ static struct vimoption options[] = #else (char_u *)FALSE, #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME, (char_u *)&p_ft, PV_FT, {(char_u *)"", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP, (char_u *)&p_fcs, PV_NONE, {(char_u *)"vert:|,fold:-", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"fixendofline", "fixeol", P_BOOL|P_VI_DEF|P_RSTAT, (char_u *)&p_fixeol, PV_FIXEOL, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"fkmap", "fk", P_BOOL|P_VI_DEF, #ifdef FEAT_FKMAP (char_u *)&p_fkmap, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"flash", "fl", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"foldclose", "fcl", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_RWIN, #ifdef FEAT_FOLDING (char_u *)&p_fcl, PV_NONE, @@ -1224,7 +1224,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldcolumn", "fdc", P_NUM|P_VI_DEF|P_RWIN, #ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDC, @@ -1233,7 +1233,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldenable", "fen", P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FEN, @@ -1242,7 +1242,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldexpr", "fde", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, #if defined(FEAT_FOLDING) && defined(FEAT_EVAL) (char_u *)VAR_WIN, PV_FDE, @@ -1251,7 +1251,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldignore", "fdi", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, #ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDI, @@ -1260,7 +1260,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldlevel", "fdl", P_NUM|P_VI_DEF|P_RWIN, #ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDL, @@ -1269,7 +1269,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldlevelstart","fdls", P_NUM|P_VI_DEF|P_CURSWANT, #ifdef FEAT_FOLDING (char_u *)&p_fdls, PV_NONE, @@ -1278,7 +1278,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldmarker", "fmr", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF| P_RWIN|P_ONECOMMA|P_NODUP, #ifdef FEAT_FOLDING @@ -1288,7 +1288,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldmethod", "fdm", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, #ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDM, @@ -1297,7 +1297,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldminlines","fml", P_NUM|P_VI_DEF|P_RWIN, #ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FML, @@ -1306,7 +1306,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldnestmax", "fdn", P_NUM|P_VI_DEF|P_RWIN, #ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDN, @@ -1315,7 +1315,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldopen", "fdo", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_CURSWANT, #ifdef FEAT_FOLDING (char_u *)&p_fdo, PV_NONE, @@ -1325,7 +1325,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"foldtext", "fdt", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, #if defined(FEAT_FOLDING) && defined(FEAT_EVAL) (char_u *)VAR_WIN, PV_FDT, @@ -1334,7 +1334,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"formatexpr", "fex", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM, #ifdef FEAT_EVAL (char_u *)&p_fex, PV_FEX, @@ -1343,18 +1343,18 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"formatoptions","fo", P_STRING|P_ALLOCED|P_VIM|P_FLAGLIST, (char_u *)&p_fo, PV_FO, {(char_u *)DFLT_FO_VI, (char_u *)DFLT_FO_VIM} - SCRIPTID_INIT}, + SCTX_INIT}, {"formatlistpat","flp", P_STRING|P_ALLOCED|P_VI_DEF, (char_u *)&p_flp, PV_FLP, {(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*", - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_fp, PV_FP, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"fsync", "fs", P_BOOL|P_SECURE|P_VI_DEF, #ifdef HAVE_FSYNC (char_u *)&p_fs, PV_NONE, @@ -1363,14 +1363,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)FALSE, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"fullscreen", "fu", P_BOOL|P_NO_MKRC, #ifdef FEAT_FULLSCREEN (char_u *)&p_fullscreen, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, #else (char_u *)NULL, PV_NONE, - {(char_u *)NULL, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)NULL, (char_u *)0L} SCTX_INIT}, #endif {"fuoptions", "fuopt", P_STRING|P_COMMA|P_NODUP|P_VI_DEF, #ifdef FEAT_FULLSCREEN @@ -1380,13 +1380,13 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"gdefault", "gd", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_gd, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"graphic", "gr", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"grepformat", "gfm", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_QUICKFIX (char_u *)&p_gefm, PV_NONE, @@ -1395,7 +1395,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"grepprg", "gp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #ifdef FEAT_QUICKFIX (char_u *)&p_gp, PV_GP, @@ -1421,7 +1421,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"guicursor", "gcr", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef CURSOR_SHAPE (char_u *)&p_guicursor, PV_NONE, @@ -1436,7 +1436,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"guifont", "gfn", P_STRING|P_VI_DEF|P_RCLR|P_ONECOMMA|P_NODUP, #ifdef FEAT_GUI (char_u *)&p_guifont, PV_NONE, @@ -1445,7 +1445,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"guifontset", "gfs", P_STRING|P_VI_DEF|P_RCLR|P_ONECOMMA, #if defined(FEAT_GUI) && defined(FEAT_XFONTSET) (char_u *)&p_guifontset, PV_NONE, @@ -1454,7 +1454,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"guifontwide", "gfw", P_STRING|P_VI_DEF|P_RCLR|P_ONECOMMA|P_NODUP, #if defined(FEAT_GUI) && defined(FEAT_MBYTE) (char_u *)&p_guifontwide, PV_NONE, @@ -1463,14 +1463,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"guiheadroom", "ghr", P_NUM|P_VI_DEF, #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) (char_u *)&p_ghr, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)50L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)50L, (char_u *)0L} SCTX_INIT}, {"guioptions", "go", P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST # ifdef FEAT_GUI_MACVIM /* Scrollbars etc. may change the view, if this happens without a @@ -1491,14 +1491,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"guipty", NULL, P_BOOL|P_VI_DEF, #if defined(FEAT_GUI) (char_u *)&p_guipty, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"guitablabel", "gtl", P_STRING|P_VI_DEF|P_RWIN, #if defined(FEAT_GUI_TABLINE) (char_u *)&p_gtl, PV_NONE, @@ -1507,7 +1507,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"guitabtooltip", "gtt", P_STRING|P_VI_DEF|P_RWIN, #if defined(FEAT_GUI_TABLINE) (char_u *)&p_gtt, PV_NONE, @@ -1516,17 +1516,17 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"hardtabs", "ht", P_NUM|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"helpfile", "hf", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_hf, PV_NONE, {(char_u *)DFLT_HELPFILE, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"helpheight", "hh", P_NUM|P_VI_DEF, (char_u *)&p_hh, PV_NONE, - {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)20L, (char_u *)0L} SCTX_INIT}, {"helplang", "hlg", P_STRING|P_VI_DEF|P_ONECOMMA, #ifdef FEAT_MULTI_LANG (char_u *)&p_hlg, PV_NONE, @@ -1535,51 +1535,51 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"hidden", "hid", P_BOOL|P_VI_DEF, (char_u *)&p_hid, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_ONECOMMA|P_NODUP, (char_u *)&p_hl, PV_NONE, {(char_u *)HIGHLIGHT_INIT, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"history", "hi", P_NUM|P_VIM, (char_u *)&p_hi, PV_NONE, - {(char_u *)0L, (char_u *)50L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)50L} SCTX_INIT}, {"hkmap", "hk", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_RIGHTLEFT (char_u *)&p_hkmap, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"hkmapp", "hkp", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_RIGHTLEFT (char_u *)&p_hkmapp, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"hlsearch", "hls", P_BOOL|P_VI_DEF|P_VIM|P_RALL, (char_u *)&p_hls, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"icon", NULL, P_BOOL|P_VI_DEF, #ifdef FEAT_TITLE (char_u *)&p_icon, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"iconstring", NULL, P_STRING|P_VI_DEF, #ifdef FEAT_TITLE (char_u *)&p_iconstring, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"ignorecase", "ic", P_BOOL|P_VI_DEF, (char_u *)&p_ic, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"imactivatefunc","imaf",P_STRING|P_VI_DEF|P_SECURE, #if defined(FEAT_EVAL) && defined(FEAT_MBYTE) (char_u *)&p_imaf, PV_NONE, @@ -1588,21 +1588,21 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} # endif - SCRIPTID_INIT}, + SCTX_INIT}, {"imactivatekey","imak",P_STRING|P_VI_DEF, #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) (char_u *)&p_imak, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"imcmdline", "imc", P_BOOL|P_VI_DEF, #ifdef FEAT_MBYTE (char_u *)&p_imcmdline, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"imdisable", "imd", P_BOOL|P_VI_DEF, #ifdef FEAT_MBYTE (char_u *)&p_imdisable, PV_NONE, @@ -1614,15 +1614,15 @@ static struct vimoption options[] = #else {(char_u *)FALSE, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"iminsert", "imi", P_NUM|P_VI_DEF, (char_u *)&p_iminsert, PV_IMI, {(char_u *)B_IMODE_NONE, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"imsearch", "ims", P_NUM|P_VI_DEF, (char_u *)&p_imsearch, PV_IMS, {(char_u *)B_IMODE_USE_INSERT, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"imstatusfunc","imsf",P_STRING|P_VI_DEF|P_SECURE, #if defined(FEAT_EVAL) && defined(FEAT_MBYTE) (char_u *)&p_imsf, PV_NONE, @@ -1631,7 +1631,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"imstyle", "imst", P_NUM|P_VI_DEF|P_SECURE, #if (defined(FEAT_XIM) && defined(FEAT_GUI_GTK)) || defined(FEAT_GUI_MACVIM) (char_u *)&p_imst, PV_NONE, @@ -1644,7 +1644,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"include", "inc", P_STRING|P_ALLOCED|P_VI_DEF, #ifdef FEAT_FIND_ID (char_u *)&p_inc, PV_INC, @@ -1653,7 +1653,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"includeexpr", "inex", P_STRING|P_ALLOCED|P_VI_DEF, #if defined(FEAT_FIND_ID) && defined(FEAT_EVAL) (char_u *)&p_inex, PV_INEX, @@ -1662,10 +1662,10 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"incsearch", "is", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_is, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"indentexpr", "inde", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM, #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) (char_u *)&p_inde, PV_INDE, @@ -1674,7 +1674,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"indentkeys", "indk", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) (char_u *)&p_indk, PV_INDK, @@ -1683,13 +1683,13 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"infercase", "inf", P_BOOL|P_VI_DEF, (char_u *)&p_inf, PV_INF, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"insertmode", "im", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_im, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"isfname", "isf", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_isf, PV_NONE, { @@ -1712,7 +1712,7 @@ static struct vimoption options[] = # endif # endif #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"isident", "isi", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_isi, PV_NONE, { @@ -1729,7 +1729,7 @@ static struct vimoption options[] = (char_u *)"@,48-57,_,192-255", # endif #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"iskeyword", "isk", P_STRING|P_ALLOCED|P_VIM|P_COMMA|P_NODUP, (char_u *)&p_isk, PV_ISK, { @@ -1748,7 +1748,7 @@ static struct vimoption options[] = ISK_LATIN1 # endif #endif - } SCRIPTID_INIT}, + } SCTX_INIT}, {"isprint", "isp", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP, (char_u *)&p_isp, PV_NONE, { @@ -1762,10 +1762,10 @@ static struct vimoption options[] = ISP_LATIN1, # endif #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"joinspaces", "js", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_js, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"key", NULL, P_STRING|P_ALLOCED|P_VI_DEF|P_NO_MKRC, #ifdef FEAT_CRYPT (char_u *)&p_key, PV_KEY, @@ -1774,7 +1774,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME|P_PRI_MKRC, #ifdef FEAT_KEYMAP (char_u *)&p_keymap, PV_KMAP, @@ -1783,10 +1783,10 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"keymodel", "km", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_km, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_kp, PV_KP, { @@ -1803,7 +1803,7 @@ static struct vimoption options[] = # endif # endif #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"langmap", "lmap", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_SECURE, #ifdef FEAT_LANGMAP (char_u *)&p_langmap, PV_NONE, @@ -1812,41 +1812,41 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"langmenu", "lm", P_STRING|P_VI_DEF|P_NFNAME, #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG) (char_u *)&p_lm, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"langnoremap", "lnr", P_BOOL|P_VI_DEF, #ifdef FEAT_LANGMAP (char_u *)&p_lnr, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"langremap", "lrm", P_BOOL|P_VI_DEF, #ifdef FEAT_LANGMAP (char_u *)&p_lrm, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL, (char_u *)&p_ls, PV_NONE, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} SCTX_INIT}, {"lazyredraw", "lz", P_BOOL|P_VI_DEF, (char_u *)&p_lz, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"linebreak", "lbr", P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_LINEBREAK (char_u *)VAR_WIN, PV_LBR, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"lines", NULL, P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR, (char_u *)&Rows, PV_NONE, { @@ -1855,7 +1855,7 @@ static struct vimoption options[] = #else (char_u *)24L, #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"linespace", "lsp", P_NUM|P_VI_DEF|P_RCLR, #ifdef FEAT_GUI (char_u *)&p_linespace, PV_NONE, @@ -1867,14 +1867,14 @@ static struct vimoption options[] = #else {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"lisp", NULL, P_BOOL|P_VI_DEF, #ifdef FEAT_LISP (char_u *)&p_lisp, PV_LISP, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"lispwords", "lw", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_LISP (char_u *)&p_lispwords, PV_LW, @@ -1883,16 +1883,16 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"list", NULL, P_BOOL|P_VI_DEF|P_RWIN, (char_u *)VAR_WIN, PV_LIST, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"listchars", "lcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP, (char_u *)&p_lcs, PV_NONE, - {(char_u *)"eol:$", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"eol:$", (char_u *)0L} SCTX_INIT}, {"loadplugins", "lpl", P_BOOL|P_VI_DEF, (char_u *)&p_lpl, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"luadll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_LUA) (char_u *)&p_luadll, PV_NONE, @@ -1901,7 +1901,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"macatsui", NULL, P_BOOL|P_VI_DEF|P_RCLR, #ifdef FEAT_GUI_MAC (char_u *)&p_macatsui, PV_NONE, @@ -1910,7 +1910,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"macligatures", NULL, P_BOOL|P_VI_DEF|P_RCLR, #ifdef FEAT_GUI_MACVIM (char_u *)&p_macligatures, PV_NONE, @@ -1937,7 +1937,7 @@ static struct vimoption options[] = #endif {"magic", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_magic, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"makeef", "mef", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #ifdef FEAT_QUICKFIX (char_u *)&p_mef, PV_NONE, @@ -1946,7 +1946,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"makeencoding","menc", P_STRING|P_VI_DEF, #ifdef FEAT_MBYTE (char_u *)&p_menc, PV_MENC, @@ -1955,7 +1955,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"makeprg", "mp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #ifdef FEAT_QUICKFIX (char_u *)&p_mp, PV_MP, @@ -1968,52 +1968,52 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"matchpairs", "mps", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_mps, PV_MPS, {(char_u *)"(:),{:},[:]", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"matchtime", "mat", P_NUM|P_VI_DEF, (char_u *)&p_mat, PV_NONE, - {(char_u *)5L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)5L, (char_u *)0L} SCTX_INIT}, {"maxcombine", "mco", P_NUM|P_VI_DEF|P_CURSWANT, #ifdef FEAT_MBYTE (char_u *)&p_mco, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)2, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)2, (char_u *)0L} SCTX_INIT}, {"maxfuncdepth", "mfd", P_NUM|P_VI_DEF, #ifdef FEAT_EVAL (char_u *)&p_mfd, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)100L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)100L, (char_u *)0L} SCTX_INIT}, {"maxmapdepth", "mmd", P_NUM|P_VI_DEF, (char_u *)&p_mmd, PV_NONE, - {(char_u *)1000L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1000L, (char_u *)0L} SCTX_INIT}, {"maxmem", "mm", P_NUM|P_VI_DEF, (char_u *)&p_mm, PV_NONE, {(char_u *)DFLT_MAXMEM, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"maxmempattern","mmp", P_NUM|P_VI_DEF, (char_u *)&p_mmp, PV_NONE, - {(char_u *)1000L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1000L, (char_u *)0L} SCTX_INIT}, {"maxmemtot", "mmt", P_NUM|P_VI_DEF, (char_u *)&p_mmt, PV_NONE, {(char_u *)DFLT_MAXMEMTOT, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"menuitems", "mis", P_NUM|P_VI_DEF, #ifdef FEAT_MENU (char_u *)&p_mis, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)25L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)25L, (char_u *)0L} SCTX_INIT}, {"mesg", NULL, P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"mkspellmem", "msm", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE, #ifdef FEAT_SPELL (char_u *)&p_msm, PV_NONE, @@ -2022,22 +2022,22 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"modeline", "ml", P_BOOL|P_VIM, (char_u *)&p_ml, PV_ML, - {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, {"modelines", "mls", P_NUM|P_VI_DEF, (char_u *)&p_mls, PV_NONE, - {(char_u *)5L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)5L, (char_u *)0L} SCTX_INIT}, {"modifiable", "ma", P_BOOL|P_VI_DEF|P_NOGLOB, (char_u *)&p_ma, PV_MA, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"modified", "mod", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT, (char_u *)&p_mod, PV_MOD, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"more", NULL, P_BOOL|P_VIM, (char_u *)&p_more, PV_NONE, - {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, {"mouse", NULL, P_STRING|P_VI_DEF|P_FLAGLIST, (char_u *)&p_mouse, PV_NONE, { @@ -2046,21 +2046,21 @@ static struct vimoption options[] = #else (char_u *)"", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"mousefocus", "mousef", P_BOOL|P_VI_DEF, #ifdef FEAT_GUI (char_u *)&p_mousef, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"mousehide", "mh", P_BOOL|P_VI_DEF, #ifdef FEAT_GUI (char_u *)&p_mh, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"mousemodel", "mousem", P_STRING|P_VI_DEF, (char_u *)&p_mousem, PV_NONE, { @@ -2073,7 +2073,7 @@ static struct vimoption options[] = (char_u *)"extend", # endif #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"mouseshape", "mouses", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_MOUSESHAPE (char_u *)&p_mouseshape, PV_NONE, @@ -2082,10 +2082,10 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"mousetime", "mouset", P_NUM|P_VI_DEF, (char_u *)&p_mouset, PV_NONE, - {(char_u *)500L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)500L, (char_u *)0L} SCTX_INIT}, {"mzschemedll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_MZSCHEME) (char_u *)&p_mzschemedll, PV_NONE, @@ -2094,7 +2094,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"mzschemegcdll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_MZSCHEME) (char_u *)&p_mzschemegcdll, PV_NONE, @@ -2103,31 +2103,31 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"mzquantum", "mzq", P_NUM, #ifdef FEAT_MZSCHEME (char_u *)&p_mzq, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)100L, (char_u *)100L} SCRIPTID_INIT}, + {(char_u *)100L, (char_u *)100L} SCTX_INIT}, {"novice", NULL, P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"nrformats", "nf", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_nf, PV_NF, {(char_u *)"bin,octal,hex", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"number", "nu", P_BOOL|P_VI_DEF|P_RWIN, (char_u *)VAR_WIN, PV_NU, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM, #ifdef FEAT_LINEBREAK (char_u *)VAR_WIN, PV_NUW, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)8L, (char_u *)4L} SCRIPTID_INIT}, + {(char_u *)8L, (char_u *)4L} SCTX_INIT}, {"omnifunc", "ofu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE, #ifdef FEAT_COMPL_FUNC (char_u *)&p_ofu, PV_OFU, @@ -2136,10 +2136,10 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"open", NULL, P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"opendevice", "odev", P_BOOL|P_VI_DEF, #if defined(MSWIN) (char_u *)&p_odev, PV_NONE, @@ -2147,31 +2147,31 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, #endif {(char_u *)FALSE, (char_u *)FALSE} - SCRIPTID_INIT}, + SCTX_INIT}, {"operatorfunc", "opfunc", P_STRING|P_VI_DEF|P_SECURE, (char_u *)&p_opfunc, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"optimize", "opt", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"osfiletype", "oft", P_STRING|P_ALLOCED|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"packpath", "pp", P_STRING|P_VI_DEF|P_EXPAND|P_ONECOMMA|P_NODUP |P_SECURE, (char_u *)&p_pp, PV_NONE, {(char_u *)DFLT_RUNTIMEPATH, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"paragraphs", "para", P_STRING|P_VI_DEF, (char_u *)&p_para, PV_NONE, {(char_u *)"IPLPPPQPP TPHPLIPpLpItpplpipbp", - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"paste", NULL, P_BOOL|P_VI_DEF|P_PRI_MKRC, (char_u *)&p_paste, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"pastetoggle", "pt", P_STRING|P_VI_DEF, (char_u *)&p_pt, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"patchexpr", "pex", P_STRING|P_VI_DEF|P_SECURE, #if defined(FEAT_DIFF) && defined(FEAT_EVAL) (char_u *)&p_pex, PV_NONE, @@ -2180,10 +2180,10 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"patchmode", "pm", P_STRING|P_VI_DEF|P_NFNAME, (char_u *)&p_pm, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_path, PV_PATH, { @@ -2192,7 +2192,7 @@ static struct vimoption options[] = #else (char_u *)".,/usr/include,,", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"perldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_PERL) (char_u *)&p_perldll, PV_NONE, @@ -2201,24 +2201,24 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"preserveindent", "pi", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_pi, PV_PI, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"previewheight", "pvh", P_NUM|P_VI_DEF, #if defined(FEAT_QUICKFIX) (char_u *)&p_pvh, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)12L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)12L, (char_u *)0L} SCTX_INIT}, {"previewwindow", "pvw", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB, #if defined(FEAT_QUICKFIX) (char_u *)VAR_WIN, PV_PVW, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"printdevice", "pdev", P_STRING|P_VI_DEF|P_SECURE, #ifdef FEAT_PRINTER (char_u *)&p_pdev, PV_NONE, @@ -2227,7 +2227,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"printencoding", "penc", P_STRING|P_VI_DEF, #ifdef FEAT_POSTSCRIPT (char_u *)&p_penc, PV_NONE, @@ -2236,7 +2236,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"printexpr", "pexpr", P_STRING|P_VI_DEF|P_SECURE, #ifdef FEAT_POSTSCRIPT (char_u *)&p_pexpr, PV_NONE, @@ -2245,7 +2245,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"printfont", "pfn", P_STRING|P_VI_DEF, #ifdef FEAT_PRINTER (char_u *)&p_pfn, PV_NONE, @@ -2260,7 +2260,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"printheader", "pheader", P_STRING|P_VI_DEF|P_GETTEXT, #ifdef FEAT_PRINTER (char_u *)&p_header, PV_NONE, @@ -2271,7 +2271,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"printmbcharset", "pmbcs", P_STRING|P_VI_DEF, #if defined(FEAT_POSTSCRIPT) && defined(FEAT_MBYTE) (char_u *)&p_pmcs, PV_NONE, @@ -2280,7 +2280,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"printmbfont", "pmbfn", P_STRING|P_VI_DEF, #if defined(FEAT_POSTSCRIPT) && defined(FEAT_MBYTE) (char_u *)&p_pmfn, PV_NONE, @@ -2289,7 +2289,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"printoptions", "popt", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_PRINTER (char_u *)&p_popt, PV_NONE, @@ -2298,24 +2298,24 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"prompt", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_prompt, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"pumheight", "ph", P_NUM|P_VI_DEF, #ifdef FEAT_INS_EXPAND (char_u *)&p_ph, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"pumwidth", "pw", P_NUM|P_VI_DEF, #ifdef FEAT_INS_EXPAND (char_u *)&p_pw, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)15L, (char_u *)15L} SCRIPTID_INIT}, + {(char_u *)15L, (char_u *)15L} SCTX_INIT}, {"pythonthreedll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_PYTHON3) (char_u *)&p_py3dll, PV_NONE, @@ -2324,7 +2324,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"pythonthreehome", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(FEAT_PYTHON3) (char_u *)&p_py3home, PV_NONE, @@ -2333,7 +2333,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"pythondll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_PYTHON) (char_u *)&p_pydll, PV_NONE, @@ -2342,7 +2342,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"pythonhome", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(FEAT_PYTHON) (char_u *)&p_pyhome, PV_NONE, @@ -2351,7 +2351,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"pyxversion", "pyx", P_NUM|P_VI_DEF|P_SECURE, #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) (char_u *)&p_pyx, PV_NONE, @@ -2359,7 +2359,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, #endif {(char_u *)DEFAULT_PYTHON_VER, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"quoteescape", "qe", P_STRING|P_ALLOCED|P_VI_DEF, #ifdef FEAT_TEXTOBJ (char_u *)&p_qe, PV_QE, @@ -2368,29 +2368,29 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"readonly", "ro", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB, (char_u *)&p_ro, PV_RO, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"redraw", NULL, P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"redrawtime", "rdt", P_NUM|P_VI_DEF, #ifdef FEAT_RELTIME (char_u *)&p_rdt, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)2000L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)2000L, (char_u *)0L} SCTX_INIT}, {"regexpengine", "re", P_NUM|P_VI_DEF, (char_u *)&p_re, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RWIN, (char_u *)VAR_WIN, PV_RNU, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"remap", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_remap, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"renderoptions", "rop", P_STRING|P_ONECOMMA|P_RCLR|P_VI_DEF, #ifdef FEAT_RENDER_OPTIONS (char_u *)&p_rop, PV_NONE, @@ -2399,31 +2399,31 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"report", NULL, P_NUM|P_VI_DEF, (char_u *)&p_report, PV_NONE, - {(char_u *)2L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)2L, (char_u *)0L} SCTX_INIT}, {"restorescreen", "rs", P_BOOL|P_VI_DEF, #ifdef WIN3264 (char_u *)&p_rs, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"revins", "ri", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_RIGHTLEFT (char_u *)&p_ri, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"rightleft", "rl", P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_RIGHTLEFT (char_u *)VAR_WIN, PV_RL, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"rightleftcmd", "rlc", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN, #ifdef FEAT_RIGHTLEFT (char_u *)VAR_WIN, PV_RLC, @@ -2432,7 +2432,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"rubydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_RUBY) (char_u *)&p_rubydll, PV_NONE, @@ -2441,56 +2441,56 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"ruler", "ru", P_BOOL|P_VI_DEF|P_VIM|P_RSTAT, #ifdef FEAT_CMDL_INFO (char_u *)&p_ru, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"rulerformat", "ruf", P_STRING|P_VI_DEF|P_ALLOCED|P_RSTAT, #ifdef FEAT_STL_OPT (char_u *)&p_ruf, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"runtimepath", "rtp", P_STRING|P_VI_DEF|P_EXPAND|P_ONECOMMA|P_NODUP |P_SECURE, (char_u *)&p_rtp, PV_NONE, {(char_u *)DFLT_RUNTIMEPATH, (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"scroll", "scr", P_NUM|P_NO_MKRC|P_VI_DEF, (char_u *)VAR_WIN, PV_SCROLL, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"scrollbind", "scb", P_BOOL|P_VI_DEF, (char_u *)VAR_WIN, PV_SCBIND, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"scrolljump", "sj", P_NUM|P_VI_DEF|P_VIM, (char_u *)&p_sj, PV_NONE, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} SCTX_INIT}, {"scrolloff", "so", P_NUM|P_VI_DEF|P_VIM|P_RALL, (char_u *)&p_so, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"scrollopt", "sbo", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_sbo, PV_NONE, {(char_u *)"ver,jump", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"sections", "sect", P_STRING|P_VI_DEF, (char_u *)&p_sections, PV_NONE, {(char_u *)"SHNHH HUnhsh", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"secure", NULL, P_BOOL|P_VI_DEF|P_SECURE, (char_u *)&p_secure, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"selection", "sel", P_STRING|P_VI_DEF, (char_u *)&p_sel, PV_NONE, {(char_u *)"inclusive", (char_u *)0L} - SCRIPTID_INIT}, + SCTX_INIT}, {"selectmode", "slm", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_slm, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"sessionoptions", "ssop", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_SESSION (char_u *)&p_ssop, PV_NONE, @@ -2500,7 +2500,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"shell", "sh", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_sh, PV_NONE, { @@ -2513,7 +2513,7 @@ static struct vimoption options[] = (char_u *)"sh", # endif #endif /* VMS */ - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"shellcmdflag","shcf", P_STRING|P_VI_DEF|P_SECURE, (char_u *)&p_shcf, PV_NONE, { @@ -2522,7 +2522,7 @@ static struct vimoption options[] = #else (char_u *)"-c", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"shellpipe", "sp", P_STRING|P_VI_DEF|P_SECURE, #ifdef FEAT_QUICKFIX (char_u *)&p_sp, PV_NONE, @@ -2537,30 +2537,30 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"shellquote", "shq", P_STRING|P_VI_DEF|P_SECURE, (char_u *)&p_shq, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"shellredir", "srr", P_STRING|P_VI_DEF|P_SECURE, (char_u *)&p_srr, PV_NONE, - {(char_u *)">", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)">", (char_u *)0L} SCTX_INIT}, {"shellslash", "ssl", P_BOOL|P_VI_DEF, #ifdef BACKSLASH_IN_FILENAME (char_u *)&p_ssl, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"shelltemp", "stmp", P_BOOL, (char_u *)&p_stmp, PV_NONE, - {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, {"shelltype", "st", P_NUM|P_VI_DEF, #ifdef AMIGA (char_u *)&p_st, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"shellxquote", "sxq", P_STRING|P_VI_DEF|P_SECURE, (char_u *)&p_sxq, PV_NONE, { @@ -2569,7 +2569,7 @@ static struct vimoption options[] = #else (char_u *)"", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"shellxescape", "sxe", P_STRING|P_VI_DEF|P_SECURE, (char_u *)&p_sxe, PV_NONE, { @@ -2578,27 +2578,27 @@ static struct vimoption options[] = #else (char_u *)"", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"shiftround", "sr", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_sr, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"shiftwidth", "sw", P_NUM|P_VI_DEF, (char_u *)&p_sw, PV_SW, - {(char_u *)8L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)8L, (char_u *)0L} SCTX_INIT}, {"shortmess", "shm", P_STRING|P_VIM|P_FLAGLIST, (char_u *)&p_shm, PV_NONE, {(char_u *)"", (char_u *)"filnxtToO"} - SCRIPTID_INIT}, + SCTX_INIT}, {"shortname", "sn", P_BOOL|P_VI_DEF, (char_u *)&p_sn, PV_SN, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"showbreak", "sbr", P_STRING|P_VI_DEF|P_RALL, #ifdef FEAT_LINEBREAK (char_u *)&p_sbr, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"showcmd", "sc", P_BOOL|P_VIM, #ifdef FEAT_CMDL_INFO (char_u *)&p_sc, PV_NONE, @@ -2611,25 +2611,25 @@ static struct vimoption options[] = #else (char_u *)TRUE #endif - } SCRIPTID_INIT}, + } SCTX_INIT}, {"showfulltag", "sft", P_BOOL|P_VI_DEF, (char_u *)&p_sft, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"showmatch", "sm", P_BOOL|P_VI_DEF, (char_u *)&p_sm, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"showmode", "smd", P_BOOL|P_VIM, (char_u *)&p_smd, PV_NONE, - {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, {"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL, (char_u *)&p_stal, PV_NONE, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} SCTX_INIT}, {"sidescroll", "ss", P_NUM|P_VI_DEF, (char_u *)&p_ss, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF, (char_u *)&p_siso, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"signcolumn", "scl", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN, #ifdef FEAT_SIGNS (char_u *)VAR_WIN, PV_SCL, @@ -2638,36 +2638,36 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"slowopen", "slow", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"smartcase", "scs", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_scs, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"smartindent", "si", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_SMARTINDENT (char_u *)&p_si, PV_SI, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"smarttab", "sta", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_sta, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"softtabstop", "sts", P_NUM|P_VI_DEF|P_VIM, (char_u *)&p_sts, PV_STS, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"sourceany", NULL, P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"spell", NULL, P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_SPELL (char_u *)VAR_WIN, PV_SPELL, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"spellcapcheck", "spc", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF, #ifdef FEAT_SPELL (char_u *)&p_spc, PV_SPC, @@ -2676,7 +2676,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"spellfile", "spf", P_STRING|P_EXPAND|P_ALLOCED|P_VI_DEF|P_SECURE |P_ONECOMMA, #ifdef FEAT_SPELL @@ -2686,7 +2686,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"spelllang", "spl", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA |P_RBUF|P_EXPAND, #ifdef FEAT_SPELL @@ -2696,7 +2696,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE|P_ONECOMMA, #ifdef FEAT_SPELL (char_u *)&p_sps, PV_NONE, @@ -2705,27 +2705,27 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"splitbelow", "sb", P_BOOL|P_VI_DEF, (char_u *)&p_sb, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"splitright", "spr", P_BOOL|P_VI_DEF, (char_u *)&p_spr, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"startofline", "sol", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_sol, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"statusline" ,"stl", P_STRING|P_VI_DEF|P_ALLOCED|P_RSTAT, #ifdef FEAT_STL_OPT (char_u *)&p_stl, PV_STL, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"suffixes", "su", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_su, PV_NONE, {(char_u *)".bak,~,.o,.h,.info,.swp,.obj", - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"suffixesadd", "sua", P_STRING|P_VI_DEF|P_ALLOCED|P_ONECOMMA|P_NODUP, #ifdef FEAT_SEARCHPATH (char_u *)&p_sua, PV_SUA, @@ -2734,16 +2734,16 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"swapfile", "swf", P_BOOL|P_VI_DEF|P_RSTAT, (char_u *)&p_swf, PV_SWF, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"swapsync", "sws", P_STRING|P_VI_DEF, (char_u *)&p_sws, PV_NONE, - {(char_u *)"fsync", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"fsync", (char_u *)0L} SCTX_INIT}, {"switchbuf", "swb", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_swb, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"synmaxcol", "smc", P_NUM|P_VI_DEF|P_RBUF, #ifdef FEAT_SYN_HL (char_u *)&p_smc, PV_SMC, @@ -2752,7 +2752,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB|P_NFNAME, #ifdef FEAT_SYN_HL (char_u *)&p_syn, PV_SYN, @@ -2761,20 +2761,20 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"tabline", "tal", P_STRING|P_VI_DEF|P_RALL, #ifdef FEAT_STL_OPT (char_u *)&p_tal, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"tabpagemax", "tpm", P_NUM|P_VI_DEF, (char_u *)&p_tpm, PV_NONE, - {(char_u *)10L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)10L, (char_u *)0L} SCTX_INIT}, {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF, (char_u *)&p_ts, PV_TS, - {(char_u *)8L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)8L, (char_u *)0L} SCTX_INIT}, {"tagbsearch", "tbs", P_BOOL|P_VI_DEF, (char_u *)&p_tbs, PV_NONE, #ifdef VMS /* binary searching doesn't appear to work on VMS */ @@ -2782,16 +2782,16 @@ static struct vimoption options[] = #else {(char_u *)TRUE, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"tagcase", "tc", P_STRING|P_VIM, (char_u *)&p_tc, PV_TC, - {(char_u *)"followic", (char_u *)"followic"} SCRIPTID_INIT}, + {(char_u *)"followic", (char_u *)"followic"} SCTX_INIT}, {"taglength", "tl", P_NUM|P_VI_DEF, (char_u *)&p_tl, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"tagrelative", "tr", P_BOOL|P_VIM, (char_u *)&p_tr, PV_NONE, - {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, {"tags", "tag", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_tags, PV_TAGS, { @@ -2800,10 +2800,10 @@ static struct vimoption options[] = #else (char_u *)"./tags,tags", #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"tagstack", "tgst", P_BOOL|P_VI_DEF, (char_u *)&p_tgst, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"tcldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_TCL) (char_u *)&p_tcldll, PV_NONE, @@ -2812,17 +2812,17 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"term", NULL, P_STRING|P_EXPAND|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RALL, (char_u *)&T_NAME, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"termbidi", "tbidi", P_BOOL|P_VI_DEF, #ifdef FEAT_ARABIC (char_u *)&p_tbidi, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"termencoding", "tenc", P_STRING|P_VI_DEF|P_RCLR, #ifdef FEAT_MBYTE (char_u *)&p_tenc, PV_NONE, @@ -2831,7 +2831,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"termguicolors", "tgc", P_BOOL|P_VI_DEF|P_VIM|P_RCLR, #ifdef FEAT_TERMGUICOLORS (char_u *)&p_tgc, PV_NONE, @@ -2840,7 +2840,7 @@ static struct vimoption options[] = (char_u*)NULL, PV_NONE, {(char_u *)FALSE, (char_u *)FALSE} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"termwinkey", "twk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, #ifdef FEAT_TERMINAL (char_u *)VAR_WIN, PV_TWK, @@ -2849,7 +2849,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"termwinscroll", "twsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF, #ifdef FEAT_TERMINAL (char_u *)&p_twsl, PV_TWSL, @@ -2858,7 +2858,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"termwinsize", "tws", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, #ifdef FEAT_TERMINAL (char_u *)VAR_WIN, PV_TWS, @@ -2867,14 +2867,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"terse", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_terse, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"textauto", "ta", P_BOOL|P_VIM, (char_u *)&p_ta, PV_NONE, {(char_u *)DFLT_TEXTAUTO, (char_u *)TRUE} - SCRIPTID_INIT}, + SCTX_INIT}, {"textmode", "tx", P_BOOL|P_VI_DEF|P_NO_MKRC, (char_u *)&p_tx, PV_TX, { @@ -2883,40 +2883,40 @@ static struct vimoption options[] = #else (char_u *)FALSE, #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM|P_RBUF, (char_u *)&p_tw, PV_TW, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME, #ifdef FEAT_INS_EXPAND (char_u *)&p_tsr, PV_TSR, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"tildeop", "top", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_to, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"timeout", "to", P_BOOL|P_VI_DEF, (char_u *)&p_timeout, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"timeoutlen", "tm", P_NUM|P_VI_DEF, (char_u *)&p_tm, PV_NONE, - {(char_u *)1000L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1000L, (char_u *)0L} SCTX_INIT}, {"title", NULL, P_BOOL|P_VI_DEF, #ifdef FEAT_TITLE (char_u *)&p_title, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"titlelen", NULL, P_NUM|P_VI_DEF, #ifdef FEAT_TITLE (char_u *)&p_titlelen, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)85L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)85L, (char_u *)0L} SCTX_INIT}, {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT|P_SECURE|P_NO_MKRC, #ifdef FEAT_TITLE (char_u *)&p_titleold, PV_NONE, @@ -2926,14 +2926,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"titlestring", NULL, P_STRING|P_VI_DEF, #ifdef FEAT_TITLE (char_u *)&p_titlestring, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"toolbar", "tb", P_STRING|P_ONECOMMA|P_VI_DEF|P_NODUP, #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) (char_u *)&p_toolbar, PV_NONE, @@ -2942,7 +2942,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"toolbariconsize", "tbis", P_STRING|P_VI_DEF, #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM)) (char_u *)&p_tbis, PV_NONE, @@ -2951,7 +2951,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"transparency", "transp", P_NUM|P_VIM|P_RCLR, #ifdef FEAT_TRANSPARENCY (char_u *)&p_transp, PV_NONE, @@ -2961,29 +2961,29 @@ static struct vimoption options[] = {(char_u *)0L, (char_u *)0L} }, {"ttimeout", NULL, P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_ttimeout, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"ttimeoutlen", "ttm", P_NUM|P_VI_DEF, (char_u *)&p_ttm, PV_NONE, - {(char_u *)-1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)-1L, (char_u *)0L} SCTX_INIT}, {"ttybuiltin", "tbi", P_BOOL|P_VI_DEF, (char_u *)&p_tbi, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"ttyfast", "tf", P_BOOL|P_NO_MKRC|P_VI_DEF, (char_u *)&p_tf, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"ttymouse", "ttym", P_STRING|P_NODEFAULT|P_NO_MKRC|P_VI_DEF, #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS)) (char_u *)&p_ttym, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"ttyscroll", "tsl", P_NUM|P_VI_DEF, (char_u *)&p_ttyscroll, PV_NONE, - {(char_u *)999L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)999L, (char_u *)0L} SCTX_INIT}, {"ttytype", "tty", P_STRING|P_EXPAND|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RALL, (char_u *)&T_NAME, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"undodir", "udir", P_STRING|P_EXPAND|P_ONECOMMA|P_NODUP|P_SECURE |P_VI_DEF, #ifdef FEAT_PERSISTENT_UNDO @@ -2993,14 +2993,14 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"undofile", "udf", P_BOOL|P_VI_DEF|P_VIM, #ifdef FEAT_PERSISTENT_UNDO (char_u *)&p_udf, PV_UDF, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"undolevels", "ul", P_NUM|P_VI_DEF, (char_u *)&p_ul, PV_UL, { @@ -3009,16 +3009,16 @@ static struct vimoption options[] = #else (char_u *)100L, #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"undoreload", "ur", P_NUM|P_VI_DEF, (char_u *)&p_ur, PV_NONE, - { (char_u *)10000L, (char_u *)0L} SCRIPTID_INIT}, + { (char_u *)10000L, (char_u *)0L} SCTX_INIT}, {"updatecount", "uc", P_NUM|P_VI_DEF, (char_u *)&p_uc, PV_NONE, - {(char_u *)200L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)200L, (char_u *)0L} SCTX_INIT}, {"updatetime", "ut", P_NUM|P_VI_DEF, (char_u *)&p_ut, PV_NONE, - {(char_u *)4000L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)4000L, (char_u *)0L} SCTX_INIT}, {"varsofttabstop", "vsts", P_STRING|P_VI_DEF|P_VIM|P_COMMA, #ifdef FEAT_VARTABS (char_u *)&p_vsts, PV_VSTS, @@ -3027,7 +3027,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)NULL} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"vartabstop", "vts", P_STRING|P_VI_DEF|P_VIM|P_RBUF|P_COMMA, #ifdef FEAT_VARTABS (char_u *)&p_vts, PV_VTS, @@ -3036,13 +3036,13 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)"", (char_u *)NULL} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"verbose", "vbs", P_NUM|P_VI_DEF, (char_u *)&p_verbose, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"verbosefile", "vfile", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_vfile, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"viewdir", "vdir", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #ifdef FEAT_SESSION (char_u *)&p_vdir, PV_NONE, @@ -3051,7 +3051,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"viewoptions", "vop", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_SESSION (char_u *)&p_vop, PV_NONE, @@ -3061,7 +3061,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"viminfo", "vi", P_STRING|P_ONECOMMA|P_NODUP|P_SECURE, #ifdef FEAT_VIMINFO (char_u *)&p_viminfo, PV_NONE, @@ -3079,7 +3079,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"viminfofile", "vif", P_STRING|P_EXPAND|P_ONECOMMA|P_NODUP |P_SECURE|P_VI_DEF, #ifdef FEAT_VIMINFO @@ -3089,7 +3089,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"virtualedit", "ve", P_STRING|P_ONECOMMA|P_NODUP|P_VI_DEF |P_VIM|P_CURSWANT, #ifdef FEAT_VIRTUALEDIT @@ -3099,55 +3099,55 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"visualbell", "vb", P_BOOL|P_VI_DEF, (char_u *)&p_vb, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"w300", NULL, P_NUM|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"w1200", NULL, P_NUM|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"w9600", NULL, P_NUM|P_VI_DEF, (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"warn", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_warn, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"weirdinvert", "wiv", P_BOOL|P_VI_DEF|P_RCLR, (char_u *)&p_wiv, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"whichwrap", "ww", P_STRING|P_VIM|P_ONECOMMA|P_FLAGLIST, (char_u *)&p_ww, PV_NONE, - {(char_u *)"", (char_u *)"b,s"} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)"b,s"} SCTX_INIT}, {"wildchar", "wc", P_NUM|P_VIM, (char_u *)&p_wc, PV_NONE, {(char_u *)(long)Ctrl_E, (char_u *)(long)TAB} - SCRIPTID_INIT}, + SCTX_INIT}, {"wildcharm", "wcm", P_NUM|P_VI_DEF, (char_u *)&p_wcm, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"wildignore", "wig", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_WILDIGN (char_u *)&p_wig, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"wildignorecase", "wic", P_BOOL|P_VI_DEF, (char_u *)&p_wic, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"wildmenu", "wmnu", P_BOOL|P_VI_DEF, #ifdef FEAT_WILDMENU (char_u *)&p_wmnu, PV_NONE, #else (char_u *)NULL, PV_NONE, #endif - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"wildmode", "wim", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_wim, PV_NONE, - {(char_u *)"full", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"full", (char_u *)0L} SCTX_INIT}, {"wildoptions", "wop", P_STRING|P_VI_DEF, #ifdef FEAT_CMDL_COMPL (char_u *)&p_wop, PV_NONE, @@ -3156,7 +3156,7 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"winaltkeys", "wak", P_STRING|P_VI_DEF, #ifdef FEAT_WAK (char_u *)&p_wak, PV_NONE, @@ -3165,25 +3165,25 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"window", "wi", P_NUM|P_VI_DEF, (char_u *)&p_window, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"winheight", "wh", P_NUM|P_VI_DEF, (char_u *)&p_wh, PV_NONE, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} SCTX_INIT}, {"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT, (char_u *)VAR_WIN, PV_WFH, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"winfixwidth", "wfw", P_BOOL|P_VI_DEF|P_RSTAT, (char_u *)VAR_WIN, PV_WFW, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"winminheight", "wmh", P_NUM|P_VI_DEF, (char_u *)&p_wmh, PV_NONE, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} SCTX_INIT}, {"winminwidth", "wmw", P_NUM|P_VI_DEF, (char_u *)&p_wmw, PV_NONE, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} SCTX_INIT}, {"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(WIN3264) && defined(FEAT_TERMINAL) (char_u *)&p_winptydll, PV_NONE, { @@ -3197,25 +3197,25 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L} #endif - SCRIPTID_INIT}, + SCTX_INIT}, {"winwidth", "wiw", P_NUM|P_VI_DEF, (char_u *)&p_wiw, PV_NONE, - {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)20L, (char_u *)0L} SCTX_INIT}, {"wrap", NULL, P_BOOL|P_VI_DEF|P_RWIN, (char_u *)VAR_WIN, PV_WRAP, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"wrapmargin", "wm", P_NUM|P_VI_DEF, (char_u *)&p_wm, PV_WM, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"wrapscan", "ws", P_BOOL|P_VI_DEF, (char_u *)&p_ws, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"write", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_write, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, {"writeany", "wa", P_BOOL|P_VI_DEF, (char_u *)&p_wa, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"writebackup", "wb", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_wb, PV_NONE, { @@ -3224,15 +3224,15 @@ static struct vimoption options[] = #else (char_u *)FALSE, #endif - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} SCTX_INIT}, {"writedelay", "wd", P_NUM|P_VI_DEF, (char_u *)&p_wd, PV_NONE, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, /* terminal output codes */ #define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \ (char_u *)&vvv, PV_NONE, \ - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, p_term("t_AB", T_CAB) p_term("t_AF", T_CAF) @@ -3316,7 +3316,7 @@ static struct vimoption options[] = /* terminal key codes are not in here */ /* end marker */ - {NULL, NULL, 0, NULL, PV_NONE, {NULL, NULL} SCRIPTID_INIT} + {NULL, NULL, 0, NULL, PV_NONE, {NULL, NULL} SCTX_INIT} }; #define PARAM_COUNT (sizeof(options) / sizeof(struct vimoption)) @@ -3397,7 +3397,7 @@ static char_u *did_set_spell_option(int is_spellfile); static char_u *compile_cap_prog(synblock_T *synblock); #endif #ifdef FEAT_EVAL -static void set_option_scriptID_idx(int opt_idx, int opt_flags, int id); +static void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx); #endif static char_u *set_bool_option(int opt_idx, char_u *varp, int value, int opt_flags); static char_u *set_num_option(int opt_idx, char_u *varp, long value, char_u *errbuf, size_t errbuflen, int opt_flags); @@ -3958,7 +3958,7 @@ set_option_default( } #ifdef FEAT_EVAL - set_option_scriptID_idx(opt_idx, opt_flags, current_SID); + set_option_sctx_idx(opt_idx, opt_flags, current_sctx); #endif } @@ -4783,12 +4783,12 @@ do_set( { /* Mention where the option was last set. */ if (varp == options[opt_idx].var) - last_set_msg(options[opt_idx].scriptID); + last_set_msg(options[opt_idx].script_ctx); else if ((int)options[opt_idx].indir & PV_WIN) - last_set_msg(curwin->w_p_scriptID[ + last_set_msg(curwin->w_p_script_ctx[ (int)options[opt_idx].indir & PV_MASK]); else if ((int)options[opt_idx].indir & PV_BUF) - last_set_msg(curbuf->b_p_scriptID[ + last_set_msg(curbuf->b_p_script_ctx[ (int)options[opt_idx].indir & PV_MASK]); } #endif @@ -5997,8 +5997,9 @@ static void redraw_titles(void) * Set a string option to a new value (without checking the effect). * The string is copied into allocated memory. * if ("opt_idx" == -1) "name" is used, otherwise "opt_idx" is used. - * When "set_sid" is zero set the scriptID to current_SID. When "set_sid" is - * SID_NONE don't set the scriptID. Otherwise set the scriptID to "set_sid". + * When "set_sid" is zero set the scriptID to current_sctx.sc_sid. When + * "set_sid" is SID_NONE don't set the scriptID. Otherwise set the scriptID to + * "set_sid". */ void set_string_option_direct( @@ -6051,8 +6052,18 @@ set_string_option_direct( } # ifdef FEAT_EVAL if (set_sid != SID_NONE) - set_option_scriptID_idx(idx, opt_flags, - set_sid == 0 ? current_SID : set_sid); + { + sctx_T script_ctx; + + if (set_sid == 0) + script_ctx = current_sctx; + else + { + script_ctx.sc_sid = set_sid; + script_ctx.sc_lnum = 0; + } + set_option_sctx_idx(idx, opt_flags, script_ctx); + } # endif } } @@ -7779,7 +7790,7 @@ did_set_string_option( { #ifdef FEAT_EVAL /* Remember where the option was set. */ - set_option_scriptID_idx(opt_idx, opt_flags, current_SID); + set_option_sctx_idx(opt_idx, opt_flags, current_sctx); #endif /* * Free string options that are in allocated memory. @@ -8338,25 +8349,28 @@ compile_cap_prog(synblock_T *synblock) #if defined(FEAT_EVAL) || defined(PROTO) /* - * Set the scriptID for an option, taking care of setting the buffer- or + * Set the script_ctx for an option, taking care of setting the buffer- or * window-local value. */ static void -set_option_scriptID_idx(int opt_idx, int opt_flags, int id) +set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx) { int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0; int indir = (int)options[opt_idx].indir; + sctx_T new_script_ctx = script_ctx; + + new_script_ctx.sc_lnum += sourcing_lnum; /* Remember where the option was set. For local options need to do that * in the buffer or window structure. */ if (both || (opt_flags & OPT_GLOBAL) || (indir & (PV_BUF|PV_WIN)) == 0) - options[opt_idx].scriptID = id; + options[opt_idx].script_ctx = new_script_ctx; if (both || (opt_flags & OPT_LOCAL)) { if (indir & PV_BUF) - curbuf->b_p_scriptID[indir & PV_MASK] = id; + curbuf->b_p_script_ctx[indir & PV_MASK] = new_script_ctx; else if (indir & PV_WIN) - curwin->w_p_scriptID[indir & PV_MASK] = id; + curwin->w_p_script_ctx[indir & PV_MASK] = new_script_ctx; } } #endif @@ -8385,7 +8399,7 @@ set_bool_option( *(int *)varp = value; /* set the new value */ #ifdef FEAT_EVAL /* Remember where the option was set. */ - set_option_scriptID_idx(opt_idx, opt_flags, current_SID); + set_option_sctx_idx(opt_idx, opt_flags, current_sctx); #endif #ifdef FEAT_GUI @@ -9069,7 +9083,7 @@ set_num_option( *pp = value; #ifdef FEAT_EVAL /* Remember where the option was set. */ - set_option_scriptID_idx(opt_idx, opt_flags, current_SID); + set_option_sctx_idx(opt_idx, opt_flags, current_sctx); #endif #ifdef FEAT_GUI need_mouse_correct = TRUE; diff --git a/src/popupmnu.c b/src/popupmnu.c index 5248217255..0f920dc69e 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -141,8 +141,8 @@ pum_display( if (p_ph > 0 && pum_height > p_ph) pum_height = p_ph; - /* Put the pum below "pum_win_row" if possible. If there are few lines decide - * on where there is more room. */ + /* Put the pum below "pum_win_row" if possible. If there are few lines + * decide on where there is more room. */ if (pum_win_row + 2 >= below_row - pum_height && pum_win_row - above_row > (below_row - above_row) / 2) { @@ -196,11 +196,20 @@ pum_display( return; #if defined(FEAT_QUICKFIX) - /* If there is a preview window at the above avoid drawing over it. */ - if (pvwin != NULL && pum_row < above_row && pum_height > above_row) + // If there is a preview window at the above avoid drawing over it. + // Do keep at least 10 entries. + if (pvwin != NULL && pum_row < above_row && pum_height > 10) { - pum_row += above_row; - pum_height -= above_row; + if (pum_win_row - above_row < 10) + { + pum_row = pum_win_row - 10; + pum_height = 10; + } + else + { + pum_row = above_row; + pum_height = pum_win_row - above_row; + } } #endif diff --git a/src/proto/eval.pro b/src/proto/eval.pro index 537b6490ad..37170a2f07 100644 --- a/src/proto/eval.pro +++ b/src/proto/eval.pro @@ -119,7 +119,7 @@ int script_autoload(char_u *name, int reload); int read_viminfo_varlist(vir_T *virp, int writing); void write_viminfo_varlist(FILE *fp); int store_session_globals(FILE *fd); -void last_set_msg(scid_T scriptID); +void last_set_msg(sctx_T script_ctx); void reset_v_option_vars(void); void prepare_assert_error(garray_T *gap); void assert_error(garray_T *gap); diff --git a/src/structs.h b/src/structs.h index fa671f82eb..30a2fbffa7 100644 --- a/src/structs.h +++ b/src/structs.h @@ -74,6 +74,19 @@ typedef struct terminal_S term_T; typedef struct VimMenu vimmenu_T; #endif +/* + * SCript ConteXt (SCTX): identifies a script script line. + * When sourcing a script "sc_lnum" is zero, "sourcing_lnum" is the current + * line number. When executing a user function "sc_lnum" is the line where the + * function was defined, "sourcing_lnum" is the line number inside the + * function. When stored with a function, mapping, option, etc. "sc_lnum" is + * the line number in the script "sc_sid". + */ +typedef struct { + scid_T sc_sid; // script ID + linenr_T sc_lnum; // line number +} sctx_T; + /* * Reference to a buffer that stores the value of buf_free_count. * bufref_valid() only needs to check "buf" when the count differs. @@ -278,8 +291,8 @@ typedef struct #endif #ifdef FEAT_EVAL - int wo_scriptID[WV_COUNT]; /* SIDs for window-local options */ -# define w_p_scriptID w_onebuf_opt.wo_scriptID + sctx_T wo_script_ctx[WV_COUNT]; /* SCTXs for window-local options */ +# define w_p_script_ctx w_onebuf_opt.wo_script_ctx #endif } winopt_T; @@ -541,7 +554,7 @@ typedef struct expand int xp_pattern_len; /* bytes in xp_pattern before cursor */ #if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) char_u *xp_arg; /* completion function */ - int xp_scriptID; /* SID for completion function */ + sctx_T xp_script_ctx; /* SCTX for completion function */ #endif int xp_backslash; /* one of the XP_BS_ values */ #ifndef BACKSLASH_IN_FILENAME @@ -1071,7 +1084,7 @@ struct mapblock char m_nowait; /* used */ #ifdef FEAT_EVAL char m_expr; /* used, m_str is an expression */ - scid_T m_script_ID; /* ID of script where map was defined */ + sctx_T m_script_ctx; /* SCTX where map was defined */ #endif }; @@ -1361,7 +1374,7 @@ typedef struct int uf_tml_idx; /* index of line being timed; -1 if none */ int uf_tml_execed; /* line being timed was executed */ #endif - scid_T uf_script_ID; /* ID of script where function was defined, + sctx_T uf_script_ctx; /* SCTX where function was defined, used for s: variables */ int uf_refcount; /* reference count, see func_name_refcount() */ funccall_T *uf_scoped; /* l: local variables for closure */ @@ -2126,7 +2139,7 @@ struct file_buffer int b_p_initialized; /* set when options initialized */ #ifdef FEAT_EVAL - int b_p_scriptID[BV_COUNT]; /* SIDs for buffer-local options */ + sctx_T b_p_script_ctx[BV_COUNT]; /* SCTXs for buffer-local options */ #endif int b_p_ai; /* 'autoindent' */ @@ -2445,7 +2458,9 @@ struct file_buffer term_T *b_term; /* When not NULL this buffer is for a terminal * window. */ #endif - +#ifdef FEAT_DIFF + int b_diff_failed; // internal diff failed for this buffer +#endif }; /* file_buffer */ diff --git a/src/syntax.c b/src/syntax.c index a06cec6164..e6cb0dfac3 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -58,7 +58,7 @@ struct hl_group int sg_link; /* link to this highlight group ID */ int sg_set; /* combination of SG_* flags */ #ifdef FEAT_EVAL - scid_T sg_scriptID; /* script in which the group was last set */ + sctx_T sg_script_ctx; /* script in which the group was last set */ #endif }; @@ -7507,7 +7507,8 @@ do_highlight( } else if (HL_TABLE()[from_id - 1].sg_link != to_id #ifdef FEAT_EVAL - || HL_TABLE()[from_id - 1].sg_scriptID != current_SID + || HL_TABLE()[from_id - 1].sg_script_ctx.sc_sid + != current_sctx.sc_sid #endif || HL_TABLE()[from_id - 1].sg_cleared) { @@ -7515,7 +7516,8 @@ do_highlight( HL_TABLE()[from_id - 1].sg_set |= SG_LINK; HL_TABLE()[from_id - 1].sg_link = to_id; #ifdef FEAT_EVAL - HL_TABLE()[from_id - 1].sg_scriptID = current_SID; + HL_TABLE()[from_id - 1].sg_script_ctx = current_sctx; + HL_TABLE()[from_id - 1].sg_script_ctx.sc_lnum += sourcing_lnum; #endif HL_TABLE()[from_id - 1].sg_cleared = FALSE; redraw_all_later(SOME_VALID); @@ -8278,7 +8280,8 @@ do_highlight( else set_hl_attr(idx); #ifdef FEAT_EVAL - HL_TABLE()[idx].sg_scriptID = current_SID; + HL_TABLE()[idx].sg_script_ctx = current_sctx; + HL_TABLE()[idx].sg_script_ctx.sc_lnum += sourcing_lnum; #endif } @@ -8405,7 +8408,10 @@ highlight_clear(int idx) /* Clear the script ID only when there is no link, since that is not * cleared. */ if (HL_TABLE()[idx].sg_link == 0) - HL_TABLE()[idx].sg_scriptID = 0; + { + HL_TABLE()[idx].sg_script_ctx.sc_sid = 0; + HL_TABLE()[idx].sg_script_ctx.sc_lnum = 0; + } #endif } @@ -9273,7 +9279,7 @@ highlight_list_one(int id) highlight_list_arg(id, didh, LIST_STRING, 0, (char_u *)"cleared", ""); #ifdef FEAT_EVAL if (p_verbose > 0) - last_set_msg(sgp->sg_scriptID); + last_set_msg(sgp->sg_script_ctx); #endif } diff --git a/src/term.c b/src/term.c index bd40c44c4a..1fa3b98878 100644 --- a/src/term.c +++ b/src/term.c @@ -6134,7 +6134,7 @@ replace_termcodes( */ if (STRNICMP(src, "", 5) == 0) { - if (current_SID <= 0) + if (current_sctx.sc_sid <= 0) EMSG(_(e_usingsid)); else { @@ -6142,7 +6142,8 @@ replace_termcodes( result[dlen++] = K_SPECIAL; result[dlen++] = (int)KS_EXTRA; result[dlen++] = (int)KE_SNR; - sprintf((char *)result + dlen, "%ld", (long)current_SID); + sprintf((char *)result + dlen, "%ld", + (long)current_sctx.sc_sid); dlen += (int)STRLEN(result + dlen); result[dlen++] = '_'; continue; diff --git a/src/terminal.c b/src/terminal.c index 30eb5f7b44..a6214a7fa8 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -3876,6 +3876,11 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED) if (buf == NULL) return; term = buf->b_term; + if (term->tl_vterm == NULL) + { + EMSG(_("E958: Job already finished")); + return; + } if (argvars[2].v_type != VAR_UNKNOWN) { diff --git a/src/testdir/README.txt b/src/testdir/README.txt index 7aa185f0a8..c6492598ce 100644 --- a/src/testdir/README.txt +++ b/src/testdir/README.txt @@ -15,23 +15,40 @@ TO ADD A NEW STYLE TEST: 1) Create a test_.vim file. 2) Add test_.res to NEW_TESTS in Make_all.mak in alphabetical order. -3) Also add an entry in src/Makefile. +3) Also add an entry "test_" in src/Make_all.mak. 4) Use make test_.res to run a single test in src/testdir/. Use make test_ to run a single test in src/. +At 2), instead of running the test separately, it can be included in +"test_alot". Do this for quick tests without side effects. The test runs a +bit faster, because Vim doesn't have to be started, one Vim instance runs many +tests. + + What you can use (see test_assert.vim for an example): + - Call assert_equal(), assert_true(), assert_false(), etc. -- Use try/catch to check for exceptions. -- Use alloc_fail() to have memory allocation fail. This makes it possible - to check memory allocation failures are handled gracefully. You need to - change the source code to add an ID to the allocation. Update LAST_ID_USED - above alloc_id() to the highest ID used. -- Use disable_char_avail_for_testing(1) if char_avail() must return FALSE for - a while. E.g. to trigger the CursorMovedI autocommand event. - See test_cursor_func.vim for an example + +- Use assert_fails() to check for expected errors. + +- Use try/catch to avoid an exception aborts the test. + +- Use alloc_fail() to have memory allocation fail. This makes it possible to + check memory allocation failures are handled gracefully. You need to change + +- the source code to add an ID to the allocation. Update LAST_ID_USED above + alloc_id() to the highest ID used. + +- Use test_override() to make Vim behave differently, e.g. if char_avail() + must return FALSE for a while. E.g. to trigger the CursorMovedI autocommand + event. + +- See test_cursor_func.vim for an example. + - If the bug that is being tested isn't fixed yet, you can throw an exception - so that it's clear this still needs work. E.g.: - throw "Skipped: Bug with and popupmenu not fixed yet" + with "Skipped" so that it's clear this still needs work. E.g.: throw + "Skipped: Bug with and popupmenu not fixed yet" + - See the start of runtest.vim for more help. diff --git a/src/testdir/dumps/Test_diff_01.dump b/src/testdir/dumps/Test_diff_01.dump new file mode 100644 index 0000000000..0dbce1f137 --- /dev/null +++ b/src/testdir/dumps/Test_diff_01.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|0+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33 +|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |7|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |7|-@19 +| @1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_02.dump b/src/testdir/dumps/Test_diff_02.dump new file mode 100644 index 0000000000..78f7978843 --- /dev/null +++ b/src/testdir/dumps/Test_diff_02.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|0+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33 +|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |7|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |7|-@19 +| @1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_03.dump b/src/testdir/dumps/Test_diff_03.dump new file mode 100644 index 0000000000..60916a831c --- /dev/null +++ b/src/testdir/dumps/Test_diff_03.dump @@ -0,0 +1,20 @@ +|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |1|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |1|-@19 +| @1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|1+0#0000000#5fd7ff255@1| @32 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_04.dump b/src/testdir/dumps/Test_diff_04.dump new file mode 100644 index 0000000000..ba9cdd81ac --- /dev/null +++ b/src/testdir/dumps/Test_diff_04.dump @@ -0,0 +1,20 @@ +|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |1|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|4| |l|i|n|e|s|:| |1|-@19 +| @1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32 +| +0#0000e05#a8a8a8255@1|1+0#0000000#5fd7ff255@1| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_05.dump b/src/testdir/dumps/Test_diff_05.dump new file mode 100644 index 0000000000..7a5d5403ed --- /dev/null +++ b/src/testdir/dumps/Test_diff_05.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|4+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32 +| +0#0000e05#a8a8a8255@1|1+0#0000000#5fd7ff255@1| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_06.dump b/src/testdir/dumps/Test_diff_06.dump new file mode 100644 index 0000000000..8cd68fdf30 --- /dev/null +++ b/src/testdir/dumps/Test_diff_06.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|2+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|3+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|4+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|4+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|5+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|6+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|7+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|8+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|9+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32||+1&&| +0#0000e05#a8a8a8255@1|1+0#0000000#ffffff0|0| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|1+0#0000000#5fd7ff255@1| @32 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_07.dump b/src/testdir/dumps/Test_diff_07.dump new file mode 100644 index 0000000000..97864c68da --- /dev/null +++ b/src/testdir/dumps/Test_diff_07.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>#+0#0000000#ffffff0|i|n|c|l|u|d|e| |<|s|t|d|i|o|.|h|>| @16||+1&&| +0#0000e05#a8a8a8255@1|#+0#0000000#ffffff0|i|n|c|l|u|d|e| |<|s|t|d|i|o|.|h|>| @16 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|/+2#0000000#ff404010@1| |F|r|o|b|s| |f|o@1| |h|e|a|r|t|i|l|y| +0&#ffd7ff255@13||+1&#ffffff0| +0#0000e05#a8a8a8255@1|i+2#0000000#ff404010|n|t| |f|i|b|(|i|n|t| |n|)| +0&#ffd7ff255@20 +| +0#0000e05#a8a8a8255@1|i+0#0000000#5fd7ff255|n|t| |f|r|o|b|n|i|t|z|(|i|n|t| |f|o@1|)| @13||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|i|n+2&#ff404010|t| |i|;| +0&#ffd7ff255@24||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|i|f+2&#ff404010|(|n| |>| |2|)| +0&#ffd7ff255@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|f|o|r|(|i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| @7||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@7|p+2&#ff404010|r|i|n|t|f|(|"|Y|o|u|r| |a|n|s|w|e|r| |i|s|:| |"|)+0&#ffd7ff255|;||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@7|r+2&#ff404010|e|t|u|r|n| |f|i|b|(|n|-|1|)| |+| |f|i|b|(|n|-|2|)+0&#ffd7ff255|; +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@7|p|r|i|n|t|f|(|"|%|d|\|n|"|,| |f|o@1|)|;| @6||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|}| @29||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|}| @29 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|r|e|t|u|r|n| |1|;| @21 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|i+2#0000000#ff404010|n|t| |f|a|c|t|(|i|n|t| |n|)| +0&#ffd7ff255@19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|/+2#0000000#ff404010@1| |F|r|o|b|s| |f|o@1| |h|e|a|r|t|i|l|y| +0&#ffd7ff255@13 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|i+0#0000000#5fd7ff255|n|t| |f|r|o|b|n|i|t|z|(|i|n|t| |f|o@1|)| @13 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|i|f+2&#ff404010|(|n| |>| |1|)| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|i|n+2&#ff404010|t| |i|;| +0&#ffd7ff255@24 +|X+3&#ffffff0|f|i|l|e|1| @12|1|,|1| @11|T|o|p| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|T|o|p +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|n|t|e|r|n|a|l| @52 diff --git a/src/testdir/dumps/Test_diff_08.dump b/src/testdir/dumps/Test_diff_08.dump new file mode 100644 index 0000000000..6445a57767 --- /dev/null +++ b/src/testdir/dumps/Test_diff_08.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>#+0#0000000#ffffff0|i|n|c|l|u|d|e| |<|s|t|d|i|o|.|h|>| @16||+1&&| +0#0000e05#a8a8a8255@1|#+0#0000000#ffffff0|i|n|c|l|u|d|e| |<|s|t|d|i|o|.|h|>| @16 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|i+0#0000000#5fd7ff255|n|t| |f|i|b|(|i|n|t| |n|)| @20 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|{+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|i|f|(|n| |>| |2|)| @21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|{| @29 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@7|r|e|t|u|r|n| |f|i|b|(|n|-|1|)| |+| |f|i|b|(|n|-|2|)|; +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|}| @29 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|r|e|t|u|r|n| |1|;| @21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|}+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@34 +| +0#0000e05#a8a8a8255@1|/+0#0000000#ffffff0@1| |F|r|o|b|s| |f|o@1| |h|e|a|r|t|i|l|y| @13||+1&&| +0#0000e05#a8a8a8255@1|/+0#0000000#ffffff0@1| |F|r|o|b|s| |f|o@1| |h|e|a|r|t|i|l|y| @13 +| +0#0000e05#a8a8a8255@1|i+0#0000000#ffffff0|n|t| |f|r|o|b|n|i|t|z|(|i|n|t| |f|o@1|)| @13||+1&&| +0#0000e05#a8a8a8255@1|i+0#0000000#ffffff0|n|t| |f|r|o|b|n|i|t|z|(|i|n|t| |f|o@1|)| @13 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|i|n|t| |i|;| @24||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|i|n|t| |i|;| @24 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|f|o|r|(|i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| @7||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|f|o|r|(|i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| @7 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@7|p|r|i|n|t|f|(|"|Y|o|u|r| |a|n|s|w|e|r| |i|s|:| |"|)|;||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +|X+3#0000000#ffffff0|f|i|l|e|1| @12|1|,|1| @11|T|o|p| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|T|o|p +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|a|l|g|o|r|i|t|h|m|:|p|a|t|i|e|n|c|e| @42 diff --git a/src/testdir/dumps/Test_diff_09.dump b/src/testdir/dumps/Test_diff_09.dump new file mode 100644 index 0000000000..6445a57767 --- /dev/null +++ b/src/testdir/dumps/Test_diff_09.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>#+0#0000000#ffffff0|i|n|c|l|u|d|e| |<|s|t|d|i|o|.|h|>| @16||+1&&| +0#0000e05#a8a8a8255@1|#+0#0000000#ffffff0|i|n|c|l|u|d|e| |<|s|t|d|i|o|.|h|>| @16 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|i+0#0000000#5fd7ff255|n|t| |f|i|b|(|i|n|t| |n|)| @20 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|{+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|i|f|(|n| |>| |2|)| @21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|{| @29 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@7|r|e|t|u|r|n| |f|i|b|(|n|-|1|)| |+| |f|i|b|(|n|-|2|)|; +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|}| @29 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|r|e|t|u|r|n| |1|;| @21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|}+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@34 +| +0#0000e05#a8a8a8255@1|/+0#0000000#ffffff0@1| |F|r|o|b|s| |f|o@1| |h|e|a|r|t|i|l|y| @13||+1&&| +0#0000e05#a8a8a8255@1|/+0#0000000#ffffff0@1| |F|r|o|b|s| |f|o@1| |h|e|a|r|t|i|l|y| @13 +| +0#0000e05#a8a8a8255@1|i+0#0000000#ffffff0|n|t| |f|r|o|b|n|i|t|z|(|i|n|t| |f|o@1|)| @13||+1&&| +0#0000e05#a8a8a8255@1|i+0#0000000#ffffff0|n|t| |f|r|o|b|n|i|t|z|(|i|n|t| |f|o@1|)| @13 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|i|n|t| |i|;| @24||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|i|n|t| |i|;| @24 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|f|o|r|(|i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| @7||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|f|o|r|(|i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| @7 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|{| @29 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@7|p|r|i|n|t|f|(|"|Y|o|u|r| |a|n|s|w|e|r| |i|s|:| |"|)|;||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +|X+3#0000000#ffffff0|f|i|l|e|1| @12|1|,|1| @11|T|o|p| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|T|o|p +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|a|l|g|o|r|i|t|h|m|:|p|a|t|i|e|n|c|e| @42 diff --git a/src/testdir/dumps/Test_diff_10.dump b/src/testdir/dumps/Test_diff_10.dump new file mode 100644 index 0000000000..70b9c8232c --- /dev/null +++ b/src/testdir/dumps/Test_diff_10.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|d|e|f| |f|i|n|a|l|i|z|e|(|v|a|l|u|e|s|)| @12||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|d|e|f| |f|i|n|a|l|i|z|e|(|v|a|l|u|e|s|)| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|v|a|l|u|e|s|.|e|a|c|h| |d|o| |||v||| @12||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|v|a|l|u|e|s|.|e|a|c|h| |d|o| |||v||| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@5|v|.|p|r|e|p|a|r|e| @19 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|e|n|d| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@34 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|v|a|l|u|e|s|.|e|a|c|h| |d|o| |||v||| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|v|.|f|i|n|a|l|i|z|e| @18||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|v|.|f|i|n|a|l|i|z|e| @18 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|e|n|d| @27||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|e|n|d| @27 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|0|-|1| @9|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|0|-|1| @9|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|n|t|e|r|n|a|l| @52 diff --git a/src/testdir/dumps/Test_diff_11.dump b/src/testdir/dumps/Test_diff_11.dump new file mode 100644 index 0000000000..0e4268ec75 --- /dev/null +++ b/src/testdir/dumps/Test_diff_11.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|d|e|f| |f|i|n|a|l|i|z|e|(|v|a|l|u|e|s|)| @12||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|d|e|f| |f|i|n|a|l|i|z|e|(|v|a|l|u|e|s|)| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|v|a|l|u|e|s|.|e|a|c|h| |d|o| |||v||| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@5|v|.|p|r|e|p|a|r|e| @19 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@3|e|n|d| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|v|a|l|u|e|s|.|e|a|c|h| |d|o| |||v||| @12||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|v|a|l|u|e|s|.|e|a|c|h| |d|o| |||v||| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|v|.|f|i|n|a|l|i|z|e| @18||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|v|.|f|i|n|a|l|i|z|e| @18 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|e|n|d| @27||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|e|n|d| @27 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|0|-|1| @9|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|0|-|1| @9|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|n|d|e|n|t|-|h|e|u|r|i|s|t|i|c| @44 diff --git a/src/testdir/dumps/Test_diff_12.dump b/src/testdir/dumps/Test_diff_12.dump new file mode 100644 index 0000000000..0ed4f91870 --- /dev/null +++ b/src/testdir/dumps/Test_diff_12.dump @@ -0,0 +1,20 @@ +|++0#0000e05#a8a8a8255| |+|-@1| |1|0| |l|i|n|e|s|:| |1|-@19||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| |1|0| |l|i|n|e|s|:| |1|-@19 +| @1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_13.dump b/src/testdir/dumps/Test_diff_13.dump new file mode 100644 index 0000000000..cc1f1ad18d --- /dev/null +++ b/src/testdir/dumps/Test_diff_13.dump @@ -0,0 +1,20 @@ +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@34||+1&&|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|0|,|0|-|1| @9|A|l@1| |X+1&&|f|i|l|e|2| @12|0|,|0|-|1| @9|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_14.dump b/src/testdir/dumps/Test_diff_14.dump new file mode 100644 index 0000000000..5f9b75f388 --- /dev/null +++ b/src/testdir/dumps/Test_diff_14.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffd7ff255|d| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|c+0#0000000#ffd7ff255|D|e+2&#ff404010| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_15.dump b/src/testdir/dumps/Test_diff_15.dump new file mode 100644 index 0000000000..0eb1813921 --- /dev/null +++ b/src/testdir/dumps/Test_diff_15.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>i+0#0000000#ffffff0|n|t| |m|a|i|n|(|)| @24||+1&&| +0#0000e05#a8a8a8255@1|i+0#0000000#ffffff0|n|t| |m|a|i|n|(|)| @24 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@2|i|f| |(|0|)| @25 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@2|{| @30 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@2|p|r|i|n|t|f|(|"|H|e|l@1|o|,| |W|o|r|l|d|!|"|)|;| @7||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|p|r|i|n|t|f|(|"|H|e|l@1|o|,| |W|o|r|l|d|!|"|)|;| @4 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@2|r|e|t|u|r|n| |0|;| @22||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|r|e|t|u|r|n| |0|;| @19 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@2|}| @30 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|&|v|i|m| |d|i|f@1|o|p|t|+|=|f|i|l@1|e|r| |d|i|f@1|o|p|t|+|=|i|w|h|i|t|e| @26 diff --git a/src/testdir/dumps/Test_diff_16.dump b/src/testdir/dumps/Test_diff_16.dump new file mode 100644 index 0000000000..74ad5b64ce --- /dev/null +++ b/src/testdir/dumps/Test_diff_16.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>i+0#0000000#ffffff0|n|t| |m|a|i|n|(|)| @24||+1&&| +0#0000e05#a8a8a8255@1|i+0#0000000#ffffff0|n|t| |m|a|i|n|(|)| @24 +| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|{+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@2|i|f| |(|0|)| @25 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@2|{| @30 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@2|p|r|i|n|t|f|(|"|H|e|l@1|o|,| |W|o|r|l|d|!|"|)|;| @7||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|p|r|i|n|t|f|(|"|H|e|l@1|o|,| |W|o|r|l|d|!|"|)|;| @4 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@2|r|e|t|u|r|n| |0|;| @22||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@5|r|e|t|u|r|n| |0|;| @19 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@2|}| @30 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33||+1#0000000&| +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @33 +|X+3#0000000&|f|i|l|e|1| @12|1|,|1| @11|A|l@1| |X+1&&|f|i|l|e|2| @12|1|,|1| @11|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|n|t|e|r|n|a|l| @52 diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim index e601ae6cd3..1b74c1b33e 100644 --- a/src/testdir/screendump.vim +++ b/src/testdir/screendump.vim @@ -93,8 +93,11 @@ endfunc " Verify that Vim running in terminal buffer "buf" matches the screen dump. " "options" is passed to term_dumpwrite(). " The file name used is "dumps/{filename}.dump". +" Optionally an extra argument can be passed which is prepended to the error +" message. Use this when using the same dump file with different options. " Will wait for up to a second for the screen dump to match. -func VerifyScreenDump(buf, filename, options) +" Returns non-zero when verification fails. +func VerifyScreenDump(buf, filename, options, ...) let reference = 'dumps/' . a:filename . '.dump' let testfile = a:filename . '.dump.failed' @@ -108,10 +111,15 @@ func VerifyScreenDump(buf, filename, options) endif if i == 100 " Leave the test file around for inspection. - call assert_report('See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")') - break + let msg = 'See dump file difference: call term_dumpdiff("' . testfile . '", "' . reference . '")' + if a:0 == 1 + let msg = a:1 . ': ' . msg + endif + call assert_report(msg) + return 1 endif sleep 10m let i += 1 endwhile + return 0 endfunc diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim index 16a3f7f8ac..7d300a4dac 100644 --- a/src/testdir/test_alot.vim +++ b/src/testdir/test_alot.vim @@ -14,6 +14,7 @@ source test_ex_z.vim source test_execute_func.vim source test_expand.vim source test_expand_dllpath.vim +source test_expand_func.vim source test_expr.vim source test_feedkeys.vim source test_file_perm.vim diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index d6c5c83fe5..c3c1eaf4a5 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1,4 +1,6 @@ " Tests for diff mode +source shared.vim +source screendump.vim func Test_diff_fold_sync() enew! @@ -33,6 +35,18 @@ func Test_diff_fold_sync() endfunc func Test_vert_split() + set diffopt=filler + call Common_vert_split() + set diffopt& +endfunc + +func Test_vert_split_internal() + set diffopt=internal,filler + call Common_vert_split() + set diffopt& +endfunc + +func Common_vert_split() " Disable the title to avoid xterm keeping the wrong one. set notitle noicon new @@ -275,10 +289,8 @@ func Test_diffoff() bwipe! endfunc -func Test_diffopt_icase() - set diffopt=icase,foldcolumn:0 - - e one +func Common_icase_test() + edit one call setline(1, ['One', 'Two', 'Three', 'Four', 'Fi#ve']) redraw let normattr = screenattr(1, 1) @@ -300,32 +312,54 @@ func Test_diffopt_icase() diffoff! %bwipe! +endfunc + +func Test_diffopt_icase() + set diffopt=icase,foldcolumn:0 + call Common_icase_test() set diffopt& endfunc -func Test_diffopt_iwhite() - set diffopt=iwhite,foldcolumn:0 +func Test_diffopt_icase_internal() + set diffopt=icase,foldcolumn:0,internal + call Common_icase_test() + set diffopt& +endfunc - e one - " Difference in trailing spaces should be ignored, +func Common_iwhite_test() + edit one + " Difference in trailing spaces and amount of spaces should be ignored, " but not other space differences. - call setline(1, ["One \t", 'Two', 'Three', 'Four']) + call setline(1, ["One \t", 'Two', 'Three', 'one two', 'one two', 'Four']) redraw let normattr = screenattr(1, 1) diffthis botright vert new two - call setline(1, ["One\t ", "Two\t ", 'Three', ' Four']) + call setline(1, ["One\t ", "Two\t ", 'Three', 'one two', 'onetwo', ' Four']) diffthis redraw call assert_equal(normattr, screenattr(1, 1)) call assert_equal(normattr, screenattr(2, 1)) call assert_equal(normattr, screenattr(3, 1)) - call assert_notequal(normattr, screenattr(4, 1)) + call assert_equal(normattr, screenattr(4, 1)) + call assert_notequal(normattr, screenattr(5, 1)) + call assert_notequal(normattr, screenattr(6, 1)) diffoff! %bwipe! +endfunc + +func Test_diffopt_iwhite() + set diffopt=iwhite,foldcolumn:0 + call Common_iwhite_test() + set diffopt& +endfunc + +func Test_diffopt_iwhite_internal() + set diffopt=internal,iwhite,foldcolumn:0 + call Common_iwhite_test() set diffopt& endfunc @@ -339,8 +373,13 @@ func Test_diffopt_context() set diffopt=context:2 call assert_equal('+-- 2 lines: 1', foldtextresult(1)) + set diffopt=internal,context:2 + call assert_equal('+-- 2 lines: 1', foldtextresult(1)) + set diffopt=context:1 call assert_equal('+-- 3 lines: 1', foldtextresult(1)) + set diffopt=internal,context:1 + call assert_equal('+-- 3 lines: 1', foldtextresult(1)) diffoff! %bwipe! @@ -348,7 +387,7 @@ func Test_diffopt_context() endfunc func Test_diffopt_horizontal() - set diffopt=horizontal + set diffopt=internal,horizontal diffsplit call assert_equal(&columns, winwidth(1)) @@ -362,7 +401,7 @@ func Test_diffopt_horizontal() endfunc func Test_diffopt_vertical() - set diffopt=vertical + set diffopt=internal,vertical diffsplit call assert_equal(&lines - 2, winheight(1)) @@ -376,7 +415,7 @@ func Test_diffopt_vertical() endfunc func Test_diffopt_hiddenoff() - set diffopt=filler,foldcolumn:0,hiddenoff + set diffopt=internal,filler,foldcolumn:0,hiddenoff e! one call setline(1, ['Two', 'Three']) redraw @@ -399,7 +438,7 @@ func Test_diffopt_hiddenoff() endfunc func Test_diffoff_hidden() - set diffopt=filler,foldcolumn:0 + set diffopt=internal,filler,foldcolumn:0 e! one call setline(1, ['Two', 'Three']) redraw @@ -629,3 +668,118 @@ func Test_diff_lastline() bwipe! bwipe! endfunc + +func WriteDiffFiles(list1, list2) + call writefile(a:list1, 'Xfile1') + call writefile(a:list2, 'Xfile2') +endfunc + +" Verify a screendump with both the external and external diff. +func VerifyBoth(buf, dumpfile, extra) + call term_sendkeys(a:buf, ":diffupdate!\") + " trailing : for leaving the cursor on the command line + for cmd in [":set diffopt=filler" . a:extra . "\:", ":set diffopt+=internal\:"] + call term_sendkeys(a:buf, cmd) + if VerifyScreenDump(a:buf, a:dumpfile, {}, cmd =~ 'internal' ? 'internal' : 'external') + break " don't let the next iteration overwrite the "failed" file. + endif + endfor +endfunc + +func Test_diff_screen() + if !CanRunVimInTerminal() || !has('menu') + return + endif + " clean up already existing swap files, just in case + call delete('.Xfile1.swp') + call delete('.Xfile2.swp') + + " Test 1: Add a line in beginning of file 2 + call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) + let buf = RunVimInTerminal('-d Xfile1 Xfile2', {}) + " Set autoread mode, ,so that Vim won't complain once we re-write the test + " files + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + call VerifyBoth(buf, 'Test_diff_01', '') + + " Test 2: Add a line in beginning of file 1 + call WriteDiffFiles([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) + call VerifyBoth(buf, 'Test_diff_02', '') + + " Test 3: Add a line at the end of file 2 + call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) + call VerifyBoth(buf, 'Test_diff_03', '') + + " Test 4: Add a line at the end of file 1 + call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) + call VerifyBoth(buf, 'Test_diff_04', '') + + " Test 5: Add a line in the middle of file 2, remove on at the end of file 1 + call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10]) + call VerifyBoth(buf, 'Test_diff_05', '') + + " Test 6: Add a line in the middle of file 1, remove on at the end of file 2 + call WriteDiffFiles([1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) + call VerifyBoth(buf, 'Test_diff_06', '') + + " Test 7 - 9: Test normal/patience/histogram diff algorithm + call WriteDiffFiles(['#include ', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{', + \ ' int i;', ' for(i = 0; i < 10; i++)', ' {', ' printf("Your answer is: ");', + \ ' printf("%d\n", foo);', ' }', '}', '', 'int fact(int n)', '{', ' if(n > 1)', ' {', + \ ' return fact(n-1) * n;', ' }', ' return 1;', '}', '', 'int main(int argc, char **argv)', + \ '{', ' frobnitz(fact(10));', '}'], + \ ['#include ', '', 'int fib(int n)', '{', ' if(n > 2)', ' {', + \ ' return fib(n-1) + fib(n-2);', ' }', ' return 1;', '}', '', '// Frobs foo heartily', + \ 'int frobnitz(int foo)', '{', ' int i;', ' for(i = 0; i < 10; i++)', ' {', + \ ' printf("%d\n", foo);', ' }', '}', '', + \ 'int main(int argc, char **argv)', '{', ' frobnitz(fib(10));', '}']) + call term_sendkeys(buf, ":diffupdate!\") + call term_sendkeys(buf, ":set diffopt+=internal\") + call VerifyScreenDump(buf, 'Test_diff_07', {}) + + call term_sendkeys(buf, ":set diffopt+=algorithm:patience\") + call VerifyScreenDump(buf, 'Test_diff_08', {}) + + call term_sendkeys(buf, ":set diffopt+=algorithm:histogram\") + call VerifyScreenDump(buf, 'Test_diff_09', {}) + + " Test 10-11: normal/indent-heuristic + call term_sendkeys(buf, ":set diffopt&vim\") + call WriteDiffFiles(['', ' def finalize(values)', '', ' values.each do |v|', ' v.finalize', ' end'], + \ ['', ' def finalize(values)', '', ' values.each do |v|', ' v.prepare', ' end', '', + \ ' values.each do |v|', ' v.finalize', ' end']) + call term_sendkeys(buf, ":diffupdate!\") + call term_sendkeys(buf, ":set diffopt+=internal\") + call VerifyScreenDump(buf, 'Test_diff_10', {}) + + call term_sendkeys(buf, ":set diffopt+=indent-heuristic\") + call VerifyScreenDump(buf, 'Test_diff_11', {}) + + " Test 12: diff the same file + call WriteDiffFiles([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) + call VerifyBoth(buf, 'Test_diff_12', '') + + " Test 13: diff an empty file + call WriteDiffFiles([], []) + call VerifyBoth(buf, 'Test_diff_13', '') + + " Test 14: test diffopt+=icase + call WriteDiffFiles(['a', 'b', 'cd'], ['A', 'b', 'cDe']) + call VerifyBoth(buf, 'Test_diff_14', " diffopt+=filler diffopt+=icase") + + " Test 15-16: test diffopt+=iwhite + call WriteDiffFiles(['int main()', '{', ' printf("Hello, World!");', ' return 0;', '}'], + \ ['int main()', '{', ' if (0)', ' {', ' printf("Hello, World!");', ' return 0;', ' }', '}']) + call term_sendkeys(buf, ":diffupdate!\") + call term_sendkeys(buf, ":set diffopt&vim diffopt+=filler diffopt+=iwhite\") + call VerifyScreenDump(buf, 'Test_diff_15', {}) + call term_sendkeys(buf, ":set diffopt+=internal\") + call VerifyScreenDump(buf, 'Test_diff_16', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('Xfile1') + call delete('Xfile2') +endfunc + diff --git a/src/testdir/test_expand_func.vim b/src/testdir/test_expand_func.vim new file mode 100644 index 0000000000..fb29c3eb7a --- /dev/null +++ b/src/testdir/test_expand_func.vim @@ -0,0 +1,66 @@ +" Tests for expand() + +let s:sfile = expand('') +let s:slnum = str2nr(expand('')) +let s:sflnum = str2nr(expand('')) + +func s:expand_sfile() + return expand('') +endfunc + +func s:expand_slnum() + return str2nr(expand('')) +endfunc + +func s:expand_sflnum() + return str2nr(expand('')) +endfunc + +func Test_expand_sfile() + call assert_match('test_expand_func\.vim$', s:sfile) + call assert_match('^function .*\.\.Test_expand_sfile$', expand('')) + + " Call in script-local function + call assert_match('^function .*\.\.Test_expand_sfile\[5\]\.\.\d\+_expand_sfile$', s:expand_sfile()) + + " Call in command + command Sfile echo expand('') + call assert_match('^function .*\.\.Test_expand_sfile$', trim(execute('Sfile'))) + delcommand Sfile +endfunc + +func Test_expand_slnum() + call assert_equal(4, s:slnum) + call assert_equal(2, str2nr(expand(''))) + + " Line-continuation + call assert_equal( + \ 5, + \ str2nr(expand(''))) + + " Call in script-local function + call assert_equal(1, s:expand_slnum()) + + " Call in command + command Slnum echo expand('') + call assert_equal(14, str2nr(trim(execute('Slnum')))) + delcommand Slnum +endfunc + +func Test_expand_sflnum() + call assert_equal(5, s:sflnum) + call assert_equal(52, str2nr(expand(''))) + + " Line-continuation + call assert_equal( + \ 55, + \ str2nr(expand(''))) + + " Call in script-local function + call assert_equal(16, s:expand_sflnum()) + + " Call in command + command Flnum echo expand('') + call assert_equal(64, str2nr(trim(execute('Flnum')))) + delcommand Flnum +endfunc diff --git a/src/testdir/test_maparg.vim b/src/testdir/test_maparg.vim index 0fb878b04a..c9e440edc0 100644 --- a/src/testdir/test_maparg.vim +++ b/src/testdir/test_maparg.vim @@ -13,19 +13,24 @@ function Test_maparg() set cpo-=< set encoding=utf8 " Test maparg() with a string result + let sid = s:SID() + let lnum = expand('') map foo isfoo vnoremap