diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index 6eec9f2ccd..9a5d36da26 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -54,7 +54,7 @@ Common combination are: - Using a job connected through pipes in NL mode. E.g., to run a style checker and receive errors and warnings. - Using a deamon, connecting over a socket in JSON mode. E.g. to lookup - crosss-refrences in a database. + cross-references in a database. ============================================================================== 2. Channel demo *channel-demo* *demoserver.py* diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 3610a0e1b1..61cf5f3de2 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 7.4. Last change: 2016 Mar 28 +*editing.txt* For Vim version 7.4. Last change: 2016 Aug 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1114,10 +1114,12 @@ The names can be in upper- or lowercase. edited. See |:confirm| and 'confirm'. {not in Vi} :q[uit]! Quit without writing, also when the current buffer has - changes. If this is the last window and there is a - modified hidden buffer, the current buffer is - abandoned and the first changed hidden buffer becomes - the current buffer. + changes. The buffer is unloaded, also when it has + 'hidden' set. + If this is the last window and there is a modified + hidden buffer, the current buffer is abandoned and the + first changed hidden buffer becomes the current + buffer. Use ":qall!" to exit always. :cq[uit] Quit always, without writing, and return an error diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 53a797ee6c..c82bfbc6c3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2016 Aug 07 +*eval.txt* For Vim version 7.4. Last change: 2016 Aug 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -9,7 +9,7 @@ Expression evaluation *expression* *expr* *E15* *eval* Using expressions is introduced in chapter 41 of the user manual |usr_41.txt|. Note: Expression evaluation can be disabled at compile time. If this has been -done, the features in this document are not available. See |+eval| and +done, the features in this document are not available. See |+eval| and |no-eval-feature|. 1. Variables |variables| @@ -29,6 +29,7 @@ done, the features in this document are not available. See |+eval| and 10. No +eval feature |no-eval-feature| 11. The sandbox |eval-sandbox| 12. Textlock |textlock| +13. Testing |testing| {Vi does not have any of these commands} @@ -127,7 +128,7 @@ evaluates to FALSE. List, Dictionary, Funcref and Job types are not automatically converted. *E805* *E806* *E808* -When mixing Number and Float the Number is converted to Float. Otherwise +When mixing Number and Float the Number is converted to Float. Otherwise there is no automatic conversion of Float. You can use str2float() for String to Float, printf() for Float to String and float2nr() for Float to Number. @@ -140,10 +141,10 @@ You will not get an error if you try to change the type of a variable. 1.2 Function references ~ *Funcref* *E695* *E718* -A Funcref variable is obtained with the |function()| function or created with -the lambda expression |expr-lambda|. It can be used in an expression in the -place of a function name, before the parenthesis around the arguments, to -invoke the function it refers to. Example: > +A Funcref variable is obtained with the |function()| function, the |funcref()| +function or created with the lambda expression |expr-lambda|. It can be used +in an expression in the place of a function name, before the parenthesis +around the arguments, to invoke the function it refers to. Example: > :let Fn = function("MyFunc") :echo Fn() @@ -175,8 +176,8 @@ arguments: > *Partial* A Funcref optionally binds a Dictionary and/or arguments. This is also called a Partial. This is created by passing the Dictionary and/or arguments to -function(). When calling the function the Dictionary and/or arguments will be -passed to the function. Example: > +function() or funcref(). When calling the function the Dictionary and/or +arguments will be passed to the function. Example: > let Cb = function('Callback', ['foo'], myDict) call Cb() @@ -207,13 +208,13 @@ this won't happen: > let otherDict.myFunction = myDict.myFunction call otherDict.myFunction() -Here "self" will be "myDict", because it was bound explitly. +Here "self" will be "myDict", because it was bound explicitly. 1.3 Lists ~ *list* *List* *Lists* *E686* A List is an ordered sequence of items. An item can be of any type. Items -can be accessed by their index number. Items can be added and removed at any +can be accessed by their index number. Items can be added and removed at any position in the sequence. @@ -224,7 +225,7 @@ Examples: > :let mylist = [1, two, 3, "four"] :let emptylist = [] -An item can be any expression. Using a List for an item creates a +An item can be any expression. Using a List for an item creates a List of Lists: > :let nestlist = [[11, 12], [21, 22], [31, 32]] @@ -283,7 +284,7 @@ length minus one is used: > :echo mylist[2:8] " result: [2, 3] NOTE: mylist[s:e] means using the variable "s:e" as index. Watch out for -using a single letter variable before the ":". Insert a space when needed: +using a single letter variable before the ":". Insert a space when needed: mylist[s : e]. @@ -412,7 +413,7 @@ This works like: > If all you want to do is modify each item in the list then the |map()| function will be a simpler method than a for loop. -Just like the |:let| command, |:for| also accepts a list of variables. This +Just like the |:let| command, |:for| also accepts a list of variables. This requires the argument to be a list of lists. > :for [lnum, col] in [[1, 3], [2, 8], [3, 0]] : call Doit(lnum, col) @@ -469,11 +470,11 @@ only appear once. Examples: > < *E713* *E716* *E717* A key is always a String. You can use a Number, it will be converted to a String automatically. Thus the String '4' and the number 4 will find the same -entry. Note that the String '04' and the Number 04 are different, since the +entry. Note that the String '04' and the Number 04 are different, since the Number will be converted to the String '4'. The empty string can be used as a key. -A value can be any expression. Using a Dictionary for a value creates a +A value can be any expression. Using a Dictionary for a value creates a nested Dictionary: > :let nestdict = {1: {11: 'a', 12: 'b'}, 2: {21: 'c'}} @@ -500,7 +501,7 @@ key lookup can be repeated: > Dictionary to List conversion ~ -You may want to loop over the entries in a dictionary. For this you need to +You may want to loop over the entries in a dictionary. For this you need to turn the Dictionary into a List and pass it to |:for|. Most often you want to loop over the keys, using the |keys()| function: > @@ -567,7 +568,7 @@ This removes all entries from "dict" with a value not matching 'x'. Dictionary function ~ *Dictionary-function* *self* *E725* *E862* When a function is defined with the "dict" attribute it can be used in a -special way with a dictionary. Example: > +special way with a dictionary. Example: > :function Mylen() dict : return len(self.data) :endfunction @@ -591,7 +592,7 @@ assigned to a Dictionary in this way: > :echo mydict.len() The function will then get a number and the value of dict.len is a |Funcref| -that references this function. The function can only be used through a +that references this function. The function can only be used through a |Funcref|. It will automatically be deleted when there is no |Funcref| remaining that refers to it. @@ -839,7 +840,7 @@ values are different: > "is#"/"isnot#" and "is?"/"isnot?" can be used to match and ignore case. When comparing a String with a Number, the String is converted to a Number, -and the comparison is done on Numbers. This means that: > +and the comparison is done on Numbers. This means that: > echo 0 == 'x' 1 because 'x' converted to a Number is zero. However: > @@ -934,7 +935,7 @@ For '+' the number is unchanged. A String will be converted to a Number first. -These three can be repeated and mixed. Examples: +These three can be repeated and mixed. Examples: !-1 == 0 !!8 == 1 --9 == 9 @@ -960,7 +961,7 @@ compatibility). Use [-1:] to get the last byte. If expr8 is a |List| then it results the item at index expr1. See |list-index| for possible index values. If the index is out of range this results in an -error. Example: > +error. Example: > :let item = mylist[-1] " get last item Generally, if a |List| index is equal to or higher than the length of the @@ -992,7 +993,7 @@ Examples: > < *slice* If expr8 is a |List| this results in a new |List| with the items indicated by -the indexes expr1a and expr1b. This works like with a String, as explained +the indexes expr1a and expr1b. This works like with a String, as explained just above. Also see |sublist| below. Examples: > :let l = mylist[:3] " first four items :let l = mylist[4:4] " List with one item @@ -1051,7 +1052,7 @@ Floating point numbers can be written in two forms: contain digits. [-+] means there is an optional plus or minus sign. {exp} is the exponent, power of 10. -Only a decimal point is accepted, not a comma. No matter what the current +Only a decimal point is accepted, not a comma. No matter what the current locale is. {only when compiled with the |+float| feature} @@ -1120,8 +1121,10 @@ A string constant accepts these special characters: \\ backslash \" double quote \ Special key named "xxx". e.g. "\" for CTRL-W. This is for use - in mappings, the 0x80 byte is escaped. Don't use to get a - utf-8 character, use \uxxxx as mentioned above. + in mappings, the 0x80 byte is escaped. + To use the double quote character it must be escaped: "". + Don't use to get a utf-8 character, use \uxxxx as + mentioned above. Note that "\xff" is stored as the byte 255, which may be invalid in some encodings. Use "\u00ff" to store character 255 according to the current value @@ -1136,11 +1139,11 @@ literal-string *literal-string* *E115* Note that single quotes are used. -This string is taken as it is. No backslashes are removed or have a special +This string is taken as it is. No backslashes are removed or have a special meaning. The only exception is that two quotes stand for one quote. Single quoted strings are useful for patterns, so that backslashes do not need -to be doubled. These two commands are equivalent: > +to be doubled. These two commands are equivalent: > if a =~ "\\s*" if a =~ '\s*' @@ -1166,7 +1169,7 @@ register *expr-register* *@r* The result is the contents of the named register, as a single string. Newlines are inserted where required. To get the contents of the unnamed -register use @" or @@. See |registers| for an explanation of the available +register use @" or @@. See |registers| for an explanation of the available registers. When using the '=' register you get the expression itself, not what it @@ -1231,7 +1234,7 @@ The arguments are optional. Example: > *closure* Lambda expressions can access outer scope variables and arguments. This is often called a closure. Example where "i" a and "a:arg" are used in a lambda -while they exists in the function scope. They remain valid even after the +while they exist in the function scope. They remain valid even after the function returns: > :function Foo(arg) : let i = 3 @@ -1326,7 +1329,7 @@ without the |+windows| feature} *global-variable* *g:var* *g:* Inside functions global variables are accessed with "g:". Omitting this will -access a variable local to a function. But "g:" can also be used in any other +access a variable local to a function. But "g:" can also be used in any other place if you like. *local-variable* *l:var* *l:* @@ -1468,7 +1471,7 @@ v:cmdarg This variable is used for two purposes: set before an autocommand event for a file read/write command is triggered. There is a leading space to make it possible to append this variable directly after the - read/write command. Note: The "+cmd" argument isn't + read/write command. Note: The "+cmd" argument isn't included here, because it will be executed anyway. 2. When printing a PostScript file with ":hardcopy" this is the argument for the ":hardcopy" command. This can be used @@ -1488,7 +1491,7 @@ v:completed_item *v:count* *count-variable* v:count The count given for the last Normal mode command. Can be used - to get the count before a mapping. Read-only. Example: > + to get the count before a mapping. Read-only. Example: > :map _x :echo "the count is " . v:count < Note: The is required to remove the line range that you get when typing ':' after a count. @@ -1511,7 +1514,7 @@ v:ctype The current locale setting for characters of the runtime See |multi-lang|. *v:dying* *dying-variable* -v:dying Normally zero. When a deadly signal is caught it's set to +v:dying Normally zero. When a deadly signal is caught it's set to one. When multiple signals are caught the number increases. Can be used in an autocommand to check if Vim didn't terminate normally. {only works on Unix} @@ -1601,7 +1604,7 @@ v:fname_out The name of the output file. Only valid while 'diffexpr' output of diff 'patchexpr' resulting patched file (*) When doing conversion for a write command (e.g., ":w - file") it will be equal to v:fname_in. When doing conversion + file") it will be equal to v:fname_in. When doing conversion for a read command (e.g., ":e file") it will be a temporary file and different from v:fname_in. @@ -1758,7 +1761,7 @@ v:prevcount The count given for the last but one Normal mode command. < Read-only. *v:profiling* *profiling-variable* -v:profiling Normally zero. Set to one after using ":profile start". +v:profiling Normally zero. Set to one after using ":profile start". See |profiling|. *v:progname* *progname-variable* @@ -1837,41 +1840,41 @@ v:swapchoice |SwapExists| autocommands can set this to the selected choice 'd' Delete swapfile 'q' Quit 'a' Abort - The value should be a single-character string. An empty value + The value should be a single-character string. An empty value results in the user being asked, as would happen when there is no SwapExists autocommand. The default is empty. *v:swapcommand* *swapcommand-variable* v:swapcommand Normal mode command to be executed after a file has been opened. Can be used for a |SwapExists| autocommand to have - another Vim open the file and jump to the right place. For + another Vim open the file and jump to the right place. For example, when jumping to a tag the value is ":tag tagname\r". For ":edit +cmd file" the value is ":cmd\r". - *v:t_TYPE* *v:t_bool* *t_bool-varialble* + *v:t_TYPE* *v:t_bool* *t_bool-variable* v:t_bool Value of Boolean type. Read-only. See: |type()| - *v:t_channel* *t_channel-varialble* + *v:t_channel* *t_channel-variable* v:t_channel Value of Channel type. Read-only. See: |type()| - *v:t_dict* *t_dict-varialble* + *v:t_dict* *t_dict-variable* v:t_dict Value of Dictionary type. Read-only. See: |type()| - *v:t_float* *t_float-varialble* + *v:t_float* *t_float-variable* v:t_float Value of Float type. Read-only. See: |type()| - *v:t_func* *t_func-varialble* + *v:t_func* *t_func-variable* v:t_func Value of Funcref type. Read-only. See: |type()| - *v:t_job* *t_job-varialble* + *v:t_job* *t_job-variable* v:t_job Value of Job type. Read-only. See: |type()| - *v:t_list* *t_list-varialble* + *v:t_list* *t_list-variable* v:t_list Value of List type. Read-only. See: |type()| - *v:t_none* *t_none-varialble* + *v:t_none* *t_none-variable* v:t_none Value of None type. Read-only. See: |type()| - *v:t_number* *t_number-varialble* + *v:t_number* *t_number-variable* v:t_number Value of Number type. Read-only. See: |type()| - *v:t_string* *t_string-varialble* + *v:t_string* *t_string-variable* v:t_string Value of String type. Read-only. See: |type()| *v:termresponse* *termresponse-variable* v:termresponse The escape sequence returned by the terminal for the |t_RV| - termcap entry. It is set when Vim receives an escape sequence + termcap entry. It is set when Vim receives an escape sequence that starts with ESC [ or CSI and ends in a 'c', with only digits, ';' and '.' in between. When this option is set, the TermResponse autocommand event is @@ -1894,7 +1897,7 @@ v:this_session Full filename of the last loaded or saved session file. See *v:throwpoint* *throwpoint-variable* v:throwpoint The point where the exception most recently caught and not - finished was thrown. Not set when commands are typed. See + finished was thrown. Not set when commands are typed. See also |v:exception| and |throw-variables|. Example: > :try @@ -1913,7 +1916,7 @@ v:true A Number with value one. Used to put "true" in JSON. See That is so that eval() can parse the string back to the same value. Read-only. *v:val* *val-variable* -v:val Value of the current item of a |List| or |Dictionary|. Only +v:val Value of the current item of a |List| or |Dictionary|. Only valid while evaluating the expression used with |map()| and |filter()|. Read-only. @@ -2030,7 +2033,7 @@ cos({expr}) Float cosine of {expr} cosh({expr}) Float hyperbolic cosine of {expr} count({list}, {expr} [, {ic} [, {start}]]) Number count how many {expr} are in {list} -cscope_connection([{num} , {dbpath} [, {prepend}]]) +cscope_connection([{num}, {dbpath} [, {prepend}]]) Number checks existence of cscope connection cursor({lnum}, {col} [, {off}]) Number move cursor to {lnum}, {col}, {off} @@ -2081,6 +2084,7 @@ garbagecollect([{atexit}]) none free memory, breaking cyclic references get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def} get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def} get({func}, {what}) any get property of funcref/partial {func} +getbufinfo([{expr}]) List information about buffers getbufline({expr}, {lnum} [, {end}]) List lines {lnum} to {end} of buffer {expr} getbufvar({expr}, {varname} [, {def}]) @@ -2092,7 +2096,8 @@ getcmdline() String return the current command-line getcmdpos() Number return cursor position in command-line getcmdtype() String return current command-line type getcmdwintype() String return current command-line window type -getcompletion({pat}, {type}) List list of cmdline completion matches +getcompletion({pat}, {type} [, {filtered}]) + List list of cmdline completion matches getcurpos() List position of the cursor getcwd([{winnr} [, {tabnr}]]) String get the current working directory getfontname([{name}]) String name of font being used @@ -2102,18 +2107,20 @@ getftime({fname}) Number last modification time of file getftype({fname}) String description of type of file {fname} getline({lnum}) String line {lnum} of current buffer getline({lnum}, {end}) List lines {lnum} to {end} of current buffer -getloclist({nr}) List list of location list items +getloclist({nr}[, {what}]) List list of location list items getmatches() List list of current matches getpid() Number process ID of Vim getpos({expr}) List position of cursor, mark, etc. -getqflist() List list of quickfix items +getqflist([{what}]) List list of quickfix items getreg([{regname} [, 1 [, {list}]]]) String or List contents of register getregtype([{regname}]) String type of register +gettabinfo([{expr}]) List list of tab pages gettabvar({nr}, {varname} [, {def}]) any variable {varname} in tab {nr} or {def} gettabwinvar({tabnr}, {winnr}, {name} [, {def}]) any {name} in {winnr} in tab page {tabnr} +getwininfo([{winid}]) List list of windows getwinposx() Number X coord in pixels of GUI Vim window getwinposy() Number Y coord in pixels of GUI Vim window getwinvar({nr}, {varname} [, {def}]) @@ -2261,11 +2268,12 @@ setcharsearch({dict}) Dict set character search from {dict} setcmdpos({pos}) Number set cursor position in command-line setfperm({fname}, {mode}) Number set {fname} file permissions to {mode} setline({lnum}, {line}) Number set line {lnum} to {line} -setloclist({nr}, {list}[, {action}]) +setloclist({nr}, {list}[, {action}[, {what}]]) Number modify location list using {list} setmatches({list}) Number restore a list of matches setpos({expr}, {list}) Number set the {expr} position to {list} -setqflist({list}[, {action}]) Number modify quickfix list using {list} +setqflist({list}[, {action}[, {what}]]) + Number modify quickfix list using {list} setreg({n}, {v}[, {opt}]) Number set register to value and type settabvar({nr}, {varname}, {val}) none set {varname} in tab page {nr} to {val} settabwinvar({tabnr}, {winnr}, {varname}, {val}) @@ -2431,7 +2439,7 @@ append({lnum}, {expr}) *append()* the current buffer. {lnum} can be zero to insert a line before the first one. Returns 1 for failure ({lnum} out of range or out of memory), - 0 for success. Example: > + 0 for success. Example: > :let failed = append(line('$'), "# THE END") :let failed = append(0, ["Chapter 1", "the beginning"]) < @@ -2656,7 +2664,7 @@ bufname({expr}) *bufname()* If {expr} is a Number, that buffer number's name is given. Number zero is the alternate buffer for the current window. If {expr} is a String, it is used as a |file-pattern| to match - with the buffer names. This is always done like 'magic' is + with the buffer names. This is always done like 'magic' is set and 'cpoptions' is empty. When there is more than one match an empty string is returned. "" or "%" can be used for the current buffer, "#" for the @@ -2702,7 +2710,7 @@ bufnr({expr} [, {create}]) bufwinid({expr}) *bufwinid()* The result is a Number, which is the window ID of the first window associated with buffer {expr}. For the use of {expr}, - see |bufname()| above. If buffer {expr} doesn't exist or + see |bufname()| above. If buffer {expr} doesn't exist or there is no such window, -1 is returned. Example: > echo "A window containing buffer 1 is " . (bufwinid(1)) @@ -2712,7 +2720,7 @@ bufwinid({expr}) *bufwinid()* bufwinnr({expr}) *bufwinnr()* The result is a Number, which is the number of the first window associated with buffer {expr}. For the use of {expr}, - see |bufname()| above. If buffer {expr} doesn't exist or + see |bufname()| above. If buffer {expr} doesn't exist or there is no such window, -1 is returned. Example: > echo "A window containing buffer 1 is " . (bufwinnr(1)) @@ -2845,7 +2853,7 @@ col({expr}) The result is a Number, which is the byte index of the column col("$") length of cursor line plus one col("'t") column of mark t col("'" . markname) column of mark markname -< The first column is 1. 0 is returned for an error. +< The first column is 1. 0 is returned for an error. For an uppercase mark the column may actually be in another buffer. For the cursor position, when 'virtualedit' is active, the @@ -2860,8 +2868,8 @@ col({expr}) The result is a Number, which is the byte index of the column complete({startcol}, {matches}) *complete()* *E785* Set the matches for Insert mode completion. Can only be used in Insert mode. You need to use a mapping - with CTRL-R = |i_CTRL-R|. It does not work after CTRL-O or - with an expression mapping. + with CTRL-R = (see |i_CTRL-R|). It does not work after CTRL-O + or with an expression mapping. {startcol} is the byte offset in the line where the completed text start. The text up to the cursor is the original text that will be replaced by the matches. Use col('.') for an @@ -2892,7 +2900,7 @@ complete_add({expr}) *complete_add()* Returns 0 for failure (empty string or out of memory), 1 when the match was added, 2 when the match was already in the list. - See |complete-functions| for an explanation of {expr}. It is + See |complete-functions| for an explanation of {expr}. It is the same as one item in the list that 'omnifunc' would return. complete_check() *complete_check()* @@ -2952,7 +2960,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) :endif < In a GUI dialog, buttons are used. The layout of the buttons depends on the 'v' flag in 'guioptions'. If it is included, - the buttons are always put vertically. Otherwise, confirm() + the buttons are always put vertically. Otherwise, confirm() tries to put the buttons in one horizontal line. If they don't fit, a vertical layout is used anyway. For some systems the horizontal layout is always used. @@ -3121,7 +3129,7 @@ ch_status({handle}) *ch_status()* still data that can be obtained with |ch_read()|. *copy()* -copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't +copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't different from using {expr} directly. When {expr} is a |List| a shallow copy is created. This means that the original |List| can be changed without changing the @@ -3233,7 +3241,7 @@ cursor({list}) deepcopy({expr}[, {noref}]) *deepcopy()* *E698* - Make a copy of {expr}. For Numbers and Strings this isn't + Make a copy of {expr}. For Numbers and Strings this isn't different from using {expr} directly. When {expr} is a |List| a full copy is created. This means that the original |List| can be changed without changing the @@ -3343,10 +3351,10 @@ executable({expr}) *executable()* searchpath for programs. *PATHEXT* On MS-DOS and MS-Windows the ".exe", ".bat", etc. can optionally be included. Then the extensions in $PATHEXT are - tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be - found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is + tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be + found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is used. A dot by itself can be used in $PATHEXT to try using - the name without an extension. When 'shell' looks like a + the name without an extension. When 'shell' looks like a Unix shell, then the name is also tried without adding an extension. On MS-DOS and MS-Windows it only checks if the file exists and @@ -3413,7 +3421,7 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined, |user-functions|). Also works for a variable that is a Funcref. varname internal variable (see - |internal-variables|). Also works + |internal-variables|). Also works for |curly-braces-names|, |Dictionary| entries, |List| items, etc. Beware that evaluating an index may cause an @@ -3501,7 +3509,7 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* version 5.0 a space was used, which caused problems when a file name contains a space] - If the expansion fails, the result is an empty string. A name + If the expansion fails, the result is an empty string. A name for a non-existing file is not included, unless {expr} does not start with '%', '#' or '<', see below. @@ -3565,7 +3573,7 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* slow, because a shell may be used to do the expansion. See |expr-env-expand|. The expanded variable is still handled like a list of file - names. When an environment variable cannot be expanded, it is + names. When an environment variable cannot be expanded, it is left unchanged. Thus ":echo expand('$FOOBAR')" results in "$FOOBAR". @@ -3588,7 +3596,7 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()* items copied is equal to the original length of the List. E.g., when {expr3} is 1 you get N new copies of the first item (where N is the original length of the List). - Use |add()| to concatenate one item to a list. To concatenate + Use |add()| to concatenate one item to a list. To concatenate two lists into a new list use the + operator: > :let newlist = [1, 2, 3] + [4, 5] < @@ -3782,7 +3790,7 @@ fmod({expr1}, {expr2}) *fmod()* fnameescape({string}) *fnameescape()* - Escape {string} for use as file name command argument. All + Escape {string} for use as file name command argument. All characters that have a special meaning, such as '%' and '|' are escaped with a backslash. For most systems the characters escaped are @@ -3819,7 +3827,7 @@ foldclosedend({lnum}) *foldclosedend()* foldlevel({lnum}) *foldlevel()* The result is a Number, which is the foldlevel of line {lnum} - in the current buffer. For nested folds the deepest level is + in the current buffer. For nested folds the deepest level is returned. If there is no fold at line {lnum}, zero is returned. It doesn't matter if the folds are open or closed. When used while updating folds (from 'foldexpr') -1 is @@ -3834,7 +3842,7 @@ foldtext() Returns a String, to be displayed for a closed fold. This is |v:foldstart|, |v:foldend| and |v:folddashes| variables. The returned string looks like this: > +-- 45 lines: abcdef -< The number of dashes depends on the foldlevel. The "45" is +< The number of dashes depends on the foldlevel. The "45" is the number of lines in the fold. "abcdef" is the text in the first non-blank line of the fold. Leading white space, "//" or "/*" and the text from the 'foldmarker' and 'commentstring' @@ -3852,7 +3860,7 @@ foldtextresult({lnum}) *foldtextresult()* {not available when compiled without the |+folding| feature} *foreground()* -foreground() Move the Vim window to the foreground. Useful when sent from +foreground() Move the Vim window to the foreground. Useful when sent from a client to a Vim server. |remote_send()| On Win32 systems this might not work, the OS does not always allow a window to bring itself to the foreground. Use @@ -3975,6 +3983,55 @@ get({func}, {what}) 'dict' The dictionary 'args' The list with arguments + *getbufinfo()* +getbufinfo([{expr}]) +getbufinfo([{dict}]) + Get information about buffers as a List of Dictionaries. + + Without an argument information about all the buffers is + returned. + + When the argument is a Dictionary only the buffers matching + the specified criteria are returned. The following keys can + be specified in {dict}: + buflisted include only listed buffers. + bufloaded include only loaded buffers. + + Otherwise, {expr} specifies a particular buffer to return + information for. For the use of {expr}, see |bufname()| + above. If the buffer is found the returned List has one item. + Otherwise the result is an empty list. + + Each returned List item is a dictionary with the following + entries: + changed TRUE if the buffer is modified. + changedtick number of changes made to the buffer. + hidden TRUE if the buffer is hidden. + listed TRUE if the buffer is listed. + lnum current line number in buffer. + loaded TRUE if the buffer is loaded. + name full path to the file in the buffer. + nr buffer number. + options dictionary of buffer local options. + signs list of signs placed in the buffer. + Each list item is a dictionary with + the following fields: + id sign identifier + lnum line number + name sign name + variables dictionary of buffer local variables. + windows list of window IDs with this buffer + + Examples: > + for buf in getbufinfo() + echo buf.name + endfor + for buf in getbufinfo({'buflisted':1}) + if buf.options.filetype == 'java' + .... + endif + endfor +< *getbufline()* getbufline({expr}, {lnum} [, {end}]) Return a |List| with the lines starting from {lnum} to {end} @@ -4099,7 +4156,7 @@ getcharmod() *getcharmod()* 96 mouse quadruple click (== 32 + 64) 128 command (Macintosh only) Only the modifiers that have not been included in the - character itself are obtained. Thus Shift-a results in "A" + character itself are obtained. Thus Shift-a results in "A" without a modifier. getcharsearch() *getcharsearch()* @@ -4158,7 +4215,7 @@ getcmdwintype() *getcmdwintype()* values are the same as |getcmdtype()|. Returns an empty string when not in the command-line window. -getcompletion({pat}, {type}) *getcompletion()* +getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* Return a list of command-line completion matches. {type} specifies what for. The following completion types are supported: @@ -4198,6 +4255,10 @@ getcompletion({pat}, {type}) *getcompletion()* Otherwise only items matching {pat} are returned. See |wildcards| for the use of special characters in {pat}. + If the optional {filtered} flag is set to 1, then 'wildignore' + is applied to filter the results. Otherwise all the matches + are returned. The 'wildignorecase' option always applies. + If there are no matches, an empty list is returned. An invalid value for {type} produces an error. @@ -4317,7 +4378,7 @@ getline({lnum} [, {end}]) < To get lines from another buffer see |getbufline()| -getloclist({nr}) *getloclist()* +getloclist({nr}[, {what}]) *getloclist()* Returns a list with all the entries in the location list for window {nr}. {nr} can be the window number or the window ID. When {nr} is zero the current window is used. @@ -4326,6 +4387,10 @@ getloclist({nr}) *getloclist()* returned. For an invalid window number {nr}, an empty list is returned. Otherwise, same as |getqflist()|. + If the optional {what} dictionary argument is supplied, then + returns the items listed in {what} as a dictionary. Refer to + |getqflist()| for the supported items in {what}. + getmatches() *getmatches()* Returns a |List| with all matches previously defined by |matchadd()| and the |:match| commands. |getmatches()| is @@ -4350,7 +4415,7 @@ getmatches() *getmatches()* *getpid()* getpid() Return a Number which is the process ID of the Vim process. On Unix and MS-Windows this is a unique number, until Vim - exits. On MS-DOS it's always zero. + exits. On MS-DOS it's always zero. *getpos()* getpos({expr}) Get the position for {expr}. For possible values of {expr} @@ -4376,7 +4441,7 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr} < Also see |getcurpos()| and |setpos()|. -getqflist() *getqflist()* +getqflist([{what}]) *getqflist()* Returns a list with all the current quickfix errors. Each list item is a dictionary with these entries: bufnr number of buffer that has the file name, use @@ -4401,13 +4466,34 @@ getqflist() *getqflist()* :for d in getqflist() : echo bufname(d.bufnr) ':' d.lnum '=' d.text :endfor +< + If the optional {what} dictionary argument is supplied, then + returns only the items listed in {what} as a dictionary. The + following string items are supported in {what}: + nr get information for this quickfix list + title get list title + winid get window id (if opened) + all all of the above quickfix properties + Non-string items in {what} are ignored. + If "nr" is not present then the current quickfix list is used. + In case of error processing {what}, an empty dictionary is + returned. + The returned dictionary contains the following entries: + nr quickfix list number + title quickfix list title text + winid quickfix window id (if opened) + + Examples: > + :echo getqflist({'all': 1}) + :echo getqflist({'nr': 2, 'title': 1}) +< getreg([{regname} [, 1 [, {list}]]]) *getreg()* The result is a String, which is the contents of register {regname}. Example: > :let cliptext = getreg('*') -< When {regname} was not set the result is a empty string. +< When {regname} was not set the result is an empty string. getreg('=') returns the last evaluated value of the expression register. (For use in maps.) @@ -4435,6 +4521,18 @@ getregtype([{regname}]) *getregtype()* is one character with value 0x16. If {regname} is not specified, |v:register| is used. +gettabinfo([{arg}]) *gettabinfo()* + If {arg} is not specified, then information about all the tab + pages is returned as a List. Each List item is a Dictionary. + Otherwise, {arg} specifies the tab page number and information + about that one is returned. If the tab page does not exist an + empty List is returned. + + Each List item is a Dictionary with the following entries: + nr tab page number. + variables dictionary of tabpage local variables. + windows List of window IDs in the tag page. + gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page {tabnr}. |t:var| @@ -4473,9 +4571,33 @@ getwinposx() The result is a Number, which is the X coordinate in pixels of *getwinposy()* getwinposy() The result is a Number, which is the Y coordinate in pixels of - the top of the GUI Vim window. The result will be -1 if the + the top of the GUI Vim window. The result will be -1 if the information is not available. +getwininfo([{winid}]) *getwininfo()* + Returns information about windows as a List with Dictionaries. + + If {winid} is given Information about the window with that ID + is returned. If the window does not exist the result is an + empty list. + + Without an information about all the windows in all the tab + pages is returned. + + Each List item is a Dictionary with the following entries: + bufnum number of buffer in the window + height window height + loclist 1 if showing a location list + {only with the +quickfix feature} + nr window number + options dictionary of window local options + quickfix 1 if quickfix or location list window + {only with the +quickfix feature} + tpnr tab page number + variables dictionary of window local variables + width window width + winid window ID + getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* Like |gettabwinvar()| for the current tabpage. Examples: > @@ -4510,7 +4632,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* :let tagfiles = glob("`find . -name tags -print`") :let &tags = substitute(tagfiles, "\n", ",", "g") < The result of the program inside the backticks should be one - item per line. Spaces inside an item are allowed. + item per line. Spaces inside an item are allowed. See |expand()| for expanding special Vim variables. See |system()| for getting the raw output of an external command. @@ -4524,6 +4646,8 @@ glob2regpat({expr}) *glob2regpat()* if filename =~ '^Make.*\.mak$' < When {expr} is an empty string the result is "^$", match an empty string. + Note that the result depends on the system. On MS-Windows + a backslash usually means a path separator. *globpath()* globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) @@ -4604,7 +4728,7 @@ hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* When {mode} is omitted, "nvo" is used. This function is useful to check if a mapping already exists - to a function in a Vim script. Example: > + to a function in a Vim script. Example: > :if !hasmapto('\ABCdoit') : map d \ABCdoit :endif @@ -4700,7 +4824,7 @@ hlID({name}) The result is a Number, which is the ID of the highlight group with name {name}. When the highlight group doesn't exist, zero is returned. This can be used to retrieve information about the highlight - group. For example, to get the background color of the + group. For example, to get the background color of the "Comment" group: > :echo synIDattr(synIDtrans(hlID("Comment")), "bg") < *highlightID()* @@ -4762,7 +4886,7 @@ input({prompt} [, {text} [, {completion}]]) *input()* in the prompt to start a new line. The highlighting set with |:echohl| is used for the prompt. The input is entered just like a command-line, with the same - editing commands and mappings. There is a separate history + editing commands and mappings. There is a separate history for lines typed for input(). Example: > :if input("Coffee or beer? ") == "beer" @@ -4776,9 +4900,9 @@ input({prompt} [, {text} [, {completion}]]) *input()* < The optional {completion} argument specifies the type of completion supported for the input. Without it completion is - not performed. The supported completion types are the same as + not performed. The supported completion types are the same as that can be supplied to a user-defined command using the - "-complete=" argument. Refer to |:command-completion| for + "-complete=" argument. Refer to |:command-completion| for more information. Example: > let fname = input("File: ", "", "file") < @@ -4819,12 +4943,12 @@ inputlist({textlist}) *inputlist()* displayed, one string per line. The user will be prompted to enter a number, which is returned. The user can also select an item by clicking on it with the - mouse. For the first string 0 is returned. When clicking + mouse. For the first string 0 is returned. When clicking above the first item a negative number is returned. When clicking on the prompt one more than the length of {textlist} is returned. Make sure {textlist} has less than 'lines' entries, otherwise - it won't work. It's a good idea to put the entry number at + it won't work. It's a good idea to put the entry number at the start of the string. And put a prompt in the first item. Example: > let color = inputlist(['Select color:', '1. red', @@ -4858,7 +4982,7 @@ inputsecret({prompt} [, {text}]) *inputsecret()* insert({list}, {item} [, {idx}]) *insert()* Insert {item} at the start of |List| {list}. If {idx} is specified insert {item} before the item with index - {idx}. If {idx} is zero it goes before the first item, just + {idx}. If {idx} is zero it goes before the first item, just like omitting {idx}. A negative {idx} is also possible, see |list-index|. -1 inserts just before the last item. Returns the resulting |List|. Examples: > @@ -5378,7 +5502,7 @@ 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 + 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. @@ -5389,7 +5513,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()* :echo match([1, 'x'], '\a') " results in 1 < See |string-match| for how {pat} is used. *strpbrk()* - Vim doesn't have a strpbrk() function. But you can do: > + Vim doesn't have a strpbrk() function. But you can do: > :let sepidx = match(line, '[.,;: \t]') < *strcasestr()* Vim doesn't have a strcasestr() function. But you can add @@ -5426,7 +5550,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()* See |pattern| for the patterns that are accepted. The 'ignorecase' option is used to set the ignore-caseness of - the pattern. 'smartcase' is NOT used. The matching is always + the pattern. 'smartcase' is NOT used. The matching is always done like 'magic' is set and 'cpoptions' is empty. *matchadd()* *E798* *E799* *E801* @@ -5442,7 +5566,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}[, {dict}]]]) concealed. The optional {priority} argument assigns a priority to the - match. A match with a high priority will have its + match. A match with a high priority will have its highlighting overrule that of a match with a lower priority. A priority is specified as an integer (negative numbers are no exception). If the {priority} argument is not specified, the @@ -5479,7 +5603,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}[, {dict}]]]) :call matchdelete(m) < A list of matches defined by |matchadd()| and |:match| are - available from |getmatches()|. All matches can be deleted in + available from |getmatches()|. All matches can be deleted in one operation by |clearmatches()|. *matchaddpos()* @@ -5615,7 +5739,7 @@ mkdir({name} [, {path} [, {prot}]]) necessary. Otherwise it must be "". If {prot} is given it is used to set the protection bits of the new directory. The default is 0755 (rwxr-xr-x: r/w for - the user readable for others). Use 0700 to make it unreadable + the user readable for others). Use 0700 to make it unreadable for others. This is only used for the last part of {name}. Thus if you create /tmp/foo/bar then /tmp/foo will be created with 0755. @@ -5760,6 +5884,7 @@ printf({fmt}, {expr1} ...) *printf()* %04x hex number padded with zeros to at least 4 characters %X hex number using upper case letters %o octal number + %08b binary number padded with zeros to at least 8 chars %f floating point number in the form 123.456 %e floating point number in the form 1.234e3 %E floating point number in the form 1.234E3 @@ -5786,6 +5911,9 @@ printf({fmt}, {expr1} ...) *printf()* character of the output string to a zero (except if a zero value is printed with an explicit precision of zero). + For b and B conversions, a non-zero result has + the string "0b" (or "0B" for B conversions) + prepended to it. For x and X conversions, a non-zero result has the string "0x" (or "0X" for X conversions) prepended to it. @@ -5793,8 +5921,8 @@ printf({fmt}, {expr1} ...) *printf()* 0 (zero) Zero padding. For all conversions the converted value is padded on the left with zeros rather than blanks. If a precision is given with a - numeric conversion (d, o, x, and X), the 0 flag - is ignored. + numeric conversion (d, b, B, o, x, and X), the 0 + flag is ignored. - A negative field width flag; the converted value is to be left adjusted on the field boundary. @@ -5806,7 +5934,7 @@ printf({fmt}, {expr1} ...) *printf()* number produced by a signed conversion (d). + A sign must always be placed before a number - produced by a signed conversion. A + overrides + produced by a signed conversion. A + overrides a space if both are used. field-width @@ -5832,7 +5960,7 @@ printf({fmt}, {expr1} ...) *printf()* A field width or precision, or both, may be indicated by an asterisk '*' instead of a digit string. In this case, a - Number argument supplies the field width or precision. A + Number argument supplies the field width or precision. A negative field width is treated as a left adjustment flag followed by a positive field width; a negative precision is treated as though it were missing. Example: > @@ -5842,12 +5970,13 @@ printf({fmt}, {expr1} ...) *printf()* The conversion specifiers and their meanings are: - *printf-d* *printf-o* *printf-x* *printf-X* - doxX The Number argument is converted to signed decimal - (d), unsigned octal (o), or unsigned hexadecimal (x - and X) notation. The letters "abcdef" are used for - x conversions; the letters "ABCDEF" are used for X - conversions. + *printf-d* *printf-b* *printf-B* *printf-o* + *printf-x* *printf-X* + dbBoxX The Number argument is converted to signed decimal + (d), unsigned binary (b and B), unsigned octal (o), or + unsigned hexadecimal (x and X) notation. The letters + "abcdef" are used for x conversions; the letters + "ABCDEF" are used for X conversions. The precision, if any, gives the minimum number of digits that must appear; if the converted value requires fewer digits, it is padded on the left with @@ -6036,7 +6165,7 @@ reltimestr({time}) *reltimestr()* *remote_expr()* *E449* remote_expr({server}, {string} [, {idvar}]) - Send the {string} to {server}. The string is sent as an + Send the {string} to {server}. The string is sent as an expression and the result is returned after evaluation. The result must be a String or a |List|. A |List| is turned into a String by joining the items with a line break in @@ -6071,7 +6200,7 @@ remote_foreground({server}) *remote_foreground()* remote_peek({serverid} [, {retvar}]) *remote_peek()* Returns a positive number if there are available strings from {serverid}. Copies any reply string into the variable - {retvar} if specified. {retvar} must be a string with the + {retvar} if specified. {retvar} must be a string with the name of a variable. Returns zero if none are available. Returns -1 if something is wrong. @@ -6093,7 +6222,7 @@ remote_read({serverid}) *remote_read()* < *remote_send()* *E241* remote_send({server}, {string} [, {idvar}]) - Send the {string} to {server}. The string is sent as input + Send the {string} to {server}. The string is sent as input keys and the function returns immediately. At the Vim server the keys are not mapped |:map|. If {idvar} is present, it is taken as the name of a variable @@ -6145,7 +6274,7 @@ repeat({expr}, {count}) *repeat()* :let separator = repeat('-', 80) < When {count} is zero or negative the result is empty. When {expr} is a |List| the result is {expr} concatenated - {count} times. Example: > + {count} times. Example: > :let longlist = repeat(['a', 'b'], 3) < Results in ['a', 'b', 'a', 'b', 'a', 'b']. @@ -6164,7 +6293,7 @@ resolve({filename}) *resolve()* *E655* path name) and also keeps a trailing path separator. *reverse()* -reverse({list}) Reverse the order of items in {list} in-place. Returns +reverse({list}) Reverse the order of items in {list} in-place. Returns {list}. If you want a list to remain unmodified make a copy first: > :let revlist = reverse(copy(mylist)) @@ -6261,7 +6390,7 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* A zero value is equal to not giving the argument. When the {timeout} argument is given the search stops when - more than this many milliseconds have passed. Thus when + more than this many milliseconds have passed. Thus when {timeout} is 500 the search stops after half a second. The value must not be negative. A zero value is like not giving the argument. @@ -6378,7 +6507,7 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip} < When starting at the "if 2", with the cursor on the "i", and searching forwards, the "endif 2" is found. When starting on the character just before the "if 2", the "endif 1" will be - found. That's because the "if 2" will be found first, and + found. That's because the "if 2" will be found first, and then this is considered to be a nested if/endif from "if 2" to "endif 2". When searching backwards and {end} is more than one character, @@ -6491,7 +6620,7 @@ setcharsearch({dict}) *setcharsearch()* setcmdpos({pos}) *setcmdpos()* Set the cursor position in the command line to byte position - {pos}. The first position is 1. + {pos}. The first position is 1. Use |getcmdpos()| to obtain the current position. Only works while editing the command line, thus you must use |c_CTRL-\_e|, |c_CTRL-R_=| or |c_CTRL-R_CTRL-R| with '='. For @@ -6540,7 +6669,7 @@ setline({lnum}, {text}) *setline()* :endfor < Note: The '[ and '] marks are not set. -setloclist({nr}, {list} [, {action}]) *setloclist()* +setloclist({nr}, {list}[, {action}[, {what}]]) *setloclist()* Create or replace or add to the location list for window {nr}. {nr} can be the window number or the window ID. When {nr} is zero the current window is used. @@ -6550,6 +6679,10 @@ setloclist({nr}, {list} [, {action}]) *setloclist()* Otherwise, same as |setqflist()|. Also see |location-list|. + If the optional {what} dictionary argument is supplied, then + only the items listed in {what} are set. Refer to |setqflist()| + for the list of supported keys in {what}. + setmatches({list}) *setmatches()* Restores a list of matches saved by |getmatches()|. Returns 0 if successful, otherwise -1. All current matches are cleared @@ -6565,7 +6698,7 @@ setpos({expr}, {list}) [bufnum, lnum, col, off] [bufnum, lnum, col, off, curswant] - "bufnum" is the buffer number. Zero can be used for the + "bufnum" is the buffer number. Zero can be used for the current buffer. Setting the cursor is only possible for the current buffer. To set a mark in another buffer you can use the |bufnr()| function to turn a file name into a buffer @@ -6602,8 +6735,7 @@ setpos({expr}, {list}) also set the preferred column. Also see the "curswant" key in |winrestview()|. - -setqflist({list} [, {action}]) *setqflist()* +setqflist({list} [, {action}[, {what}]]) *setqflist()* Create or replace or add to the quickfix list using the items in {list}. Each item in {list} is a dictionary. Non-dictionary items in {list} are ignored. Each dictionary @@ -6648,6 +6780,20 @@ setqflist({list} [, {action}]) *setqflist()* If {action} is not present or is set to ' ', then a new list is created. + If the optional {what} dictionary argument is supplied, then + only the items listed in {what} are set. The first {list} + argument is ignored. The following items can be specified in + {what}: + nr list number in the quickfix stack + title quickfix list title text + Unsupported keys in {what} are ignored. + If the "nr" item is not present, then the current quickfix list + is modified. + + Examples: > + :call setqflist([], 'r', {'title': 'My search'}) + :call setqflist([], 'r', {'nr': 2, 'title': 'Errors'}) +< Returns zero for success, -1 for failure. This function can be used to create a quickfix list @@ -7192,7 +7338,7 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()* A "~" in {sub} is not replaced with the previous {sub}. Note that some codes in {sub} have a special meaning - |sub-replace-special|. For example, to replace something with + |sub-replace-special|. For example, to replace something with "\n" (two characters), use "\\\\n" or '\\n'. When {pat} does not match in {expr}, {expr} is returned @@ -7213,9 +7359,9 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()* optional argument. Example: > :echo substitute(s, '%\(\x\x\)', SubNr, 'g') < The optional argument is a list which contains the whole - matched string and up to nine submatches,like what - |submatch()| returns. Example: > - :echo substitute(s, '\(\x\x\)', {m -> '0x' . m[1]}, 'g') + matched string and up to nine submatches, like what + |submatch()| returns. Example: > + :echo substitute(s, '%\(\x\x\)', {m -> '0x' . m[1]}, 'g') synID({lnum}, {col}, {trans}) *synID()* The result is a Number, which is the syntax ID at the position @@ -7230,7 +7376,7 @@ synID({lnum}, {col}, {trans}) *synID()* zero. When {trans} is |TRUE|, transparent items are reduced to the - item that they reveal. This is useful when wanting to know + item that they reveal. This is useful when wanting to know the effective color. When {trans} is |FALSE|, the transparent item is returned. This is useful when wanting to know which syntax item is effective (e.g. inside parens). @@ -7246,7 +7392,7 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* syntax ID {synID}. This can be used to obtain information about a syntax item. {mode} can be "gui", "cterm" or "term", to get the attributes - for that mode. When {mode} is omitted, or an invalid value is + for that mode. When {mode} is omitted, or an invalid value is used, the attributes for the currently active highlighting are used (GUI, cterm or term). Use synIDtrans() to follow linked highlight groups. @@ -7382,7 +7528,7 @@ systemlist({expr} [, {input}]) *systemlist()* tabpagebuflist([{arg}]) *tabpagebuflist()* The result is a |List|, where each item is the number of the buffer associated with each window in the current tab page. - {arg} specifies the number of tab page to be used. When + {arg} specifies the number of the tab page to be used. When omitted the current tab page is used. When {arg} is invalid the number zero is returned. To get a list of all buffers in all tabs use this: > @@ -7483,7 +7629,7 @@ tanh({expr}) *tanh()* tempname() *tempname()* *temp-file-name* The result is a String, which is the name of a file that - doesn't exist. It can be used for a temporary file. The name + doesn't exist. It can be used for a temporary file. The name is different for at least 26 consecutive calls. Example: > :let tmpfile = tempname() :exe "redir > " . tmpfile @@ -7565,9 +7711,9 @@ timer_info([{id}]) timer_pause({timer}, {paused}) *timer_pause()* Pause or unpause a timer. A paused timer does not invoke its - callback, while the time it would is not changed. Unpausing a - timer may cause the callback to be invoked almost immediately - if enough time has passed. + callback when its time expires. Unpausing a timer may cause + the callback to be invoked almost immediately if enough time + has passed. Pausing a timer is useful to avoid the callback to be called for a short time. @@ -7578,7 +7724,7 @@ timer_pause({timer}, {paused}) *timer_pause()* {only available when compiled with the |+timers| feature} - *timer_start()* + *timer_start()* *timer* *timers* timer_start({time}, {callback} [, {options}]) Create a timer and return the timer ID. @@ -7748,7 +7894,7 @@ uniq({list} [, {func} [, {dict}]]) *uniq()* *E882* each item. For the use of {func} and {dict} see |sort()|. values({dict}) *values()* - Return a |List| with all the values of {dict}. The |List| is + Return a |List| with all the values of {dict}. The |List| is in arbitrary order. @@ -7784,7 +7930,7 @@ virtcol({expr}) *virtcol()* virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5 virtcol("$") with text "foo^Lbar", returns 9 virtcol("'t") with text " there", with 't at 'h', returns 6 -< The first column is 1. 0 is returned for an error. +< The first column is 1. 0 is returned for an error. A more advanced example that echoes the maximum length of all lines: > echo max(map(range(1, line('$')), "virtcol([v:val, '$'])")) @@ -7873,7 +8019,7 @@ winheight({nr}) *winheight()* < *winline()* winline() The result is a Number, which is the screen line of the cursor - in the window. This is counting screen lines from the top of + in the window. This is counting screen lines from the top of the window. The first line is one. If the cursor was moved the view on the file will be updated first, this may cause a scroll. @@ -8040,6 +8186,10 @@ There are four types of features: < Note that it's possible for patch 147 to be omitted even though 148 is included. +Hint: To find out if Vim supports backslashes in a file name (MS-Windows), +use: `if exists('+shellslash')` + + acl Compiled with |ACL| support. all_builtin_terms Compiled with all builtin terminals enabled. amiga Amiga version of Vim. @@ -8069,7 +8219,7 @@ dialog_con Compiled with console dialog support. dialog_gui Compiled with GUI dialog support. diff Compiled with |vimdiff| and 'diff' support. digraphs Compiled with support for digraphs. -directx Compiled with support for Direct-X and 'renderoptions'. +directx Compiled with support for DirectX and 'renderoptions'. dnd Compiled with support for the "~ register |quote_~|. ebcdic Compiled on a machine with ebcdic character set. emacs_tags Compiled with support for Emacs tags. @@ -8305,9 +8455,9 @@ See |:verbose-cmd| for more information. {name} can also be a |Dictionary| entry that is a |Funcref|: > :function dict.init(arg) -< "dict" must be an existing dictionary. The entry +< "dict" must be an existing dictionary. The entry "init" is added if it didn't exist yet. Otherwise [!] - is required to overwrite an existing function. The + is required to overwrite an existing function. The result is a |Funcref| to a numbered function. The function can only be used with a |Funcref| and will be deleted if there are no more references to it. @@ -8333,7 +8483,7 @@ See |:verbose-cmd| for more information. abort as soon as an error is detected. *:func-dict* When the [dict] argument is added, the function must - be invoked through an entry in a |Dictionary|. The + be invoked through an entry in a |Dictionary|. The local variable "self" will then be set to the dictionary. See |Dictionary-function|. *:func-closure* *E932* @@ -8374,7 +8524,7 @@ See |:verbose-cmd| for more information. {name} can also be a |Dictionary| entry that is a |Funcref|: > :delfunc dict.init -< This will remove the "init" entry from "dict". The +< This will remove the "init" entry from "dict". The function is deleted if there are no more references to it. *:retu* *:return* *E133* @@ -8394,7 +8544,7 @@ See |:verbose-cmd| for more information. returns at the outermost ":endtry". *function-argument* *a:var* -An argument can be defined by giving its name. In the function this can then +An argument can be defined by giving its name. In the function this can then be used as "a:name" ("a:" for argument). *a:0* *a:1* *a:000* *E740* *...* Up to 20 arguments can be given, separated by commas. After the named @@ -8465,7 +8615,7 @@ This function can then be called with: > itself, the function is executed for each line in the range, with the cursor in the first column of that line. The cursor is left at the last line (possibly moved by the last function - call). The arguments are re-evaluated for each line. Thus + call). The arguments are re-evaluated for each line. Thus this works: *function-range-example* > :function Mynumber(arg) @@ -8510,7 +8660,7 @@ This is introduced in the user manual, section |41.14|. The autocommand is useful if you have a plugin that is a long Vim script file. You can define the autocommand and quickly quit the script with |:finish|. -That makes Vim startup faster. The autocommand should then load the same file +That makes Vim startup faster. The autocommand should then load the same file again, setting a variable to skip the |:finish| command. Use the FuncUndefined autocommand event with a pattern that matches the @@ -8592,7 +8742,7 @@ name. So in the above example, if the variable "adjective" was set to "adjective" was set to "quiet", then it would be to "my_quiet_variable". One application for this is to create a set of variables governed by an option -value. For example, the statement > +value. For example, the statement > echo my_{&background}_message would output the contents of "my_dark_message" or "my_light_message" depending @@ -8638,7 +8788,7 @@ This does NOT work: > must be a valid index in that list. For nested list the index can be repeated. This cannot be used to add an item to a |List|. - This cannot be used to set a byte in a String. You + This cannot be used to set a byte in a String. You can do that like this: > :let var = var[0:2] . 'X' . var[4:] < @@ -8683,7 +8833,7 @@ This does NOT work: > that would match everywhere. :let @{reg-name} .= {expr1} - Append {expr1} to register {reg-name}. If the + Append {expr1} to register {reg-name}. If the register was empty it's like setting it to {expr1}. :let &{option-name} = {expr1} *:let-option* *:let-&* @@ -8759,7 +8909,7 @@ This does NOT work: > |List| item. *E121* -:let {var-name} .. List the value of variable {var-name}. Multiple +:let {var-name} .. List the value of variable {var-name}. Multiple variable names may be given. Special names recognized here: *E738* g: global variables @@ -8908,7 +9058,7 @@ This does NOT work: > :for item in copy(mylist) < When not making a copy, Vim stores a reference to the next item in the list, before executing the commands - with the current item. Thus the current item can be + with the current item. Thus the current item can be removed without effect. Removing any later item means it will not be found. Thus the following example works (an inefficient way to make a list empty): > @@ -9114,7 +9264,7 @@ This does NOT work: > message in the |message-history|. When used in a script or function the line number will be added. Spaces are placed between the arguments as with the - :echo command. When used inside a try conditional, + :echo command. When used inside a try conditional, the message is raised as an error exception instead (see |try-echoerr|). Example: > @@ -9243,14 +9393,14 @@ the finally clause. It is resumed at the ":endtry", so that commands after the ":endtry" are not executed and the exception might be caught elsewhere, see |try-nesting|. When during execution of a catch clause another exception is thrown, the -remaining lines in that catch clause are not executed. The new exception is +remaining lines in that catch clause are not executed. The new exception is not matched against the patterns in any of the ":catch" commands of the same try conditional and none of its catch clauses is taken. If there is, however, a finally clause, it is executed, and the exception pends during its execution. The commands following the ":endtry" are not executed. The new exception might, however, be caught elsewhere, see |try-nesting|. When during execution of the finally clause (if present) an exception is -thrown, the remaining lines in the finally clause are skipped. If the finally +thrown, the remaining lines in the finally clause are skipped. If the finally clause has been taken because of an exception from the try block or one of the catch clauses, the original (pending) exception is discarded. The commands following the ":endtry" are not executed, and the exception from the finally @@ -9284,7 +9434,7 @@ catch an exception thrown in its try block or throws a new exception from one of its catch clauses or its finally clause, the outer try conditional is checked according to the rules above. If the inner try conditional is in the try block of the outer try conditional, its catch clauses are checked, but -otherwise only the finally clause is executed. It does not matter for +otherwise only the finally clause is executed. It does not matter for nesting, whether the inner try conditional is directly contained in the outer one, or whether the outer one sources a script or calls a function containing the inner try conditional. @@ -9347,7 +9497,7 @@ executed. > however displays "in Bar" and throws 4711. Any other command that takes an expression as argument might also be -abandoned by an (uncaught) exception during the expression evaluation. The +abandoned by an (uncaught) exception during the expression evaluation. The exception is then propagated to the caller of the command. Example: > @@ -9531,13 +9681,13 @@ CLEANUP CODE *try-finally* Scripts often change global settings and restore them at their end. If the user however interrupts the script by pressing CTRL-C, the settings remain in -an inconsistent state. The same may happen to you in the development phase of +an inconsistent state. The same may happen to you in the development phase of a script when an error occurs or you explicitly throw an exception without catching it. You can solve these problems by using a try conditional with a finally clause for restoring the settings. Its execution is guaranteed on normal control flow, on error, on an explicit ":throw", and on interrupt. (Note that errors and interrupts from inside the try conditional are converted -to exceptions. When not caught, they terminate the script after the finally +to exceptions. When not caught, they terminate the script after the finally clause has been executed.) Example: > @@ -9595,7 +9745,7 @@ This displays "first", "cleanup", "second", "cleanup", and "end". > :echo Foo() "returned by Foo" This displays "cleanup" and "4711 returned by Foo". You don't need to add an -extra ":return" in the finally clause. (Above all, this would override the +extra ":return" in the finally clause. (Above all, this would override the return value.) *except-from-finally* @@ -9639,7 +9789,7 @@ or > Vim:{errmsg} {cmdname} is the name of the command that failed; the second form is used when -the command name is not known. {errmsg} is the error message usually produced +the command name is not known. {errmsg} is the error message usually produced when the error occurs outside try conditionals. It always begins with a capital "E", followed by a two or three-digit error number, a colon, and a space. @@ -9744,7 +9894,7 @@ This works also when a try conditional is active. CATCHING INTERRUPTS *catch-interrupt* When there are active try conditionals, an interrupt (CTRL-C) is converted to -the exception "Vim:Interrupt". You can catch it like every exception. The +the exception "Vim:Interrupt". You can catch it like every exception. The script is not terminated, then. Example: > @@ -9778,7 +9928,7 @@ script is not terminated, then. :endwhile You can interrupt a task here by pressing CTRL-C; the script then asks for -a new command. If you press CTRL-C at the prompt, the script is terminated. +a new command. If you press CTRL-C at the prompt, the script is terminated. For testing what happens when CTRL-C would be pressed on a specific line in your script, use the debug mode and execute the |>quit| or |>interrupt| @@ -9935,7 +10085,7 @@ For some commands, the normal action can be replaced by a sequence of autocommands. Exceptions from that sequence will be catchable by the caller of the command. Example: For the ":write" command, the caller cannot know whether the file -had actually been written when the exception occurred. You need to tell it in +had actually been written when the exception occurred. You need to tell it in some way. > :if !exists("cnt") @@ -10083,8 +10233,8 @@ or ":endif". On the other hand, errors should be catchable as exceptions This problem has been solved by converting errors to exceptions and using immediate abortion (if not suppressed by ":silent!") only when a try -conditional is active. This is no restriction since an (error) exception can -be caught only from an active try conditional. If you want an immediate +conditional is active. This is no restriction since an (error) exception can +be caught only from an active try conditional. If you want an immediate termination without catching the error, just use a try conditional without catch clause. (You can cause cleanup code being executed before termination by specifying a finally clause.) @@ -10099,8 +10249,8 @@ conditional of a new script, you might change the control flow of the existing script on error. You get the immediate abortion on error and can catch the error in the new script. If however the sourced script suppresses error messages by using the ":silent!" command (checking for errors by testing -|v:errmsg| if appropriate), its execution path is not changed. The error is -not converted to an exception. (See |:silent|.) So the only remaining cause +|v:errmsg| if appropriate), its execution path is not changed. The error is +not converted to an exception. (See |:silent|.) So the only remaining cause where this happens is for scripts that don't care about errors and produce error messages. You probably won't want to use such code from your new scripts. @@ -10332,7 +10482,7 @@ option will still be marked as it was set in the sandbox. In a few situations it is not allowed to change the text in the buffer, jump to another window and some other things that might confuse or break what Vim is currently doing. This mostly applies to things that happen when Vim is -actually doing something else. For example, evaluating the 'balloonexpr' may +actually doing something else. For example, evaluating the 'balloonexpr' may happen any moment the mouse cursor is resting at some position. This is not allowed when the textlock is active: @@ -10342,5 +10492,26 @@ This is not allowed when the textlock is active: - closing a window or quitting Vim - etc. +============================================================================== +13. Testing *testing* + +Vim can be tested after building it, usually with "make test". +The tests are located in the directory "src/testdir". + +There are several types of tests added over time: + test33.in oldest, don't add any more + test_something.in old style tests + test_something.vim new style tests + + *new-style-testing* +New tests should be added as new style tests. These use functions such as +|assert_equal()| to keep the test commands and the expected result in one +place. + *old-style-testing* +In some cases an old style test needs to be used. E.g. when testing Vim +without the |+eval| feature. + +Find more information in the file src/testdir/README.txt. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 0c77b4bd8d..6366045587 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.4. Last change: 2016 Jul 16 +*index.txt* For Vim version 7.4. Last change: 2016 Aug 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1207,7 +1207,7 @@ tag command action ~ |:display| :di[splay] display registers |:djump| :dj[ump] jump to #define |:dl| :dl short for |:delete| with the 'l' flag -|:dl| :del[ete]l short for |:delete| with the 'l' flag +|:del| :del[ete]l short for |:delete| with the 'l' flag |:dlist| :dli[st] list #defines |:doautocmd| :do[autocmd] apply autocommands to current buffer |:doautoall| :doautoa[ll] apply autocommands for all loaded buffers diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index dcd8278dc0..eb6fc4fd5d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2016 Jul 29 +*options.txt* For Vim version 7.4. Last change: 2016 Aug 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -261,10 +261,10 @@ global value, which is used for new buffers. With ":set" both the local and global value is changed. With "setlocal" only the local value is changed, thus this value is not used when editing a new buffer. -When editing a buffer that has been edited before, the last used window -options are used again. If this buffer has been edited in this window, the -values from back then are used. Otherwise the values from the window where -the buffer was edited last are used. +When editing a buffer that has been edited before, the options from the window +that was last closed are used again. If this buffer has been edited in this +window, the values from back then are used. Otherwise the values from the +last closed window where the buffer was edited last are used. It's possible to set a local window option specifically for a type of buffer. When you edit another buffer in the same window, you don't want to keep @@ -3751,7 +3751,7 @@ A jump table for the options with a short description can be found at |Q_op|. qXX - quality XX. Valid quality names are: PROOF, DRAFT, ANTIALIASED, NONANTIALIASED, CLEARTYPE, DEFAULT. Normally you would use "qDEFAULT". - Some quality values isn't supported in legacy OSs. + Some quality values are not supported in legacy OSs. Use a ':' to separate the options. - A '_' can be used in the place of a space, so you don't need to use @@ -4058,17 +4058,16 @@ A jump table for the options with a short description can be found at |Q_op|. *'highlight'* *'hl'* 'highlight' 'hl' string (default (as a single string): - "8:SpecialKey,@:NonText,d:Directory, - e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg, - M:ModeMsg,n:LineNr,N:CursorLineNr, - r:Question,s:StatusLine,S:StatusLineNC, - c:VertSplit, t:Title,v:Visual, - w:WarningMsg,W:WildMenu, - f:Folded,F:FoldColumn,A:DiffAdd, - C:DiffChange,D:DiffDelete,T:DiffText, - >:SignColumn,B:SpellBad,P:SpellCap, - R:SpellRare,L:SpellLocal,-:Conceal, - +:Pmenu,=:PmenuSel, + "8:SpecialKey,~:EndOfBuffer,@:NonText, + d:Directory,e:ErrorMsg,i:IncSearch, + l:Search,m:MoreMsg,M:ModeMsg,n:LineNr, + N:CursorLineNr,r:Question,s:StatusLine, + S:StatusLineNC,c:VertSplit,t:Title, + v:Visual,w:WarningMsg,W:WildMenu,f:Folded, + F:FoldColumn,A:DiffAdd,C:DiffChange, + D:DiffDelete,T:DiffText,>:SignColumn, + B:SpellBad,P:SpellCap,R:SpellRare, + L:SpellLocal,-:Conceal,+:Pmenu,=:PmenuSel, x:PmenuSbar,X:PmenuThumb") global {not in Vi} @@ -4077,7 +4076,8 @@ A jump table for the options with a short description can be found at |Q_op|. first character in a pair gives the occasion, the second the mode to use for that occasion. The occasions are: |hl-SpecialKey| 8 Meta and special keys listed with ":map" - |hl-NonText| @ '~' and '@' at the end of the window and + |hl-EndOfBuffer| ~ lines after the last line in the buffer + |hl-NonText| @ '@' at the end of the window and characters from 'showbreak' |hl-Directory| d directories in CTRL-D listing and other special things in listings @@ -4517,7 +4517,7 @@ A jump table for the options with a short description can be found at |Q_op|. if you want to use Vim as a modeless editor. Used for |evim|. These Insert mode commands will be useful: - Use the cursor keys to move around. - - Use CTRL-O to execute one Normal mode command |i_CTRL-O|). When + - Use CTRL-O to execute one Normal mode command |i_CTRL-O|. When this is a mapping, it is executed as if 'insertmode' was off. Normal mode remains active until the mapping is finished. - Use CTRL-L to execute a number of Normal mode commands, then use @@ -4865,7 +4865,7 @@ A jump table for the options with a short description can be found at |Q_op|. use this command to get the tallest window possible: > :set lines=999 < Minimum value is 2, maximum value is 1000. - If you get less lines than expected, check the 'guiheadroom' option. + If you get fewer lines than expected, check the 'guiheadroom' option. When you set this option and Vim is unable to change the physical number of lines of the display, the display may be messed up. @@ -6873,10 +6873,21 @@ A jump table for the options with a short description can be found at |Q_op|. Example: Try this together with 'sidescroll' and 'listchars' as in the following example to never allow the cursor to move - onto the "extends" character: + onto the "extends" character: > :set nowrap sidescroll=1 listchars=extends:>,precedes:< :set sidescrolloff=1 +< + *'signcolumn'* *'scl'* +'signcolumn' 'scl' string (default "auto") + local to window + {not in Vi} + {not available when compiled without the |+signs| + feature} + Whether or not to draw the signcolumn. Valid values are: + "auto" only when there is a sign to display + "no" never + "yes" always *'smartcase'* *'scs'* *'nosmartcase'* *'noscs'* @@ -8079,8 +8090,8 @@ A jump table for the options with a short description can be found at |Q_op|. "xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict with them). This option is automatically set to "xterm", when the 'term' option is - set to a name that starts with "xterm", "mlterm", or "screen", and - 'ttymouse' is not set already. + set to a name that starts with "xterm", "mlterm", "screen", "st" (full + match only), "st-" or "stterm", and 'ttymouse' is not set already. Additionally, if vim is compiled with the |+termresponse| feature and |t_RV| is set to the escape sequence to request the xterm version number, more intelligent detection process runs. diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index acd6814e4b..1e7db0cd09 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.4. Last change: 2016 Jun 14 +*quickref.txt* For Vim version 7.4. Last change: 2016 Aug 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -888,6 +888,7 @@ Short explanation of each option: *option-list* 'showtabline' 'stal' tells when the tab pages line is displayed 'sidescroll' 'ss' minimum number of columns to scroll horizontal 'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor +'signcolumn' 'scl' when to display the sign column 'smartcase' 'scs' no ignore case when pattern has uppercase 'smartindent' 'si' smart autoindenting for C programs 'smarttab' 'sta' use 'shiftwidth' when inserting diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index 6c92073076..fcc6435b37 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -1,4 +1,4 @@ -*sign.txt* For Vim version 7.4. Last change: 2014 May 07 +*sign.txt* For Vim version 7.4. Last change: 2016 Aug 12 VIM REFERENCE MANUAL by Gordon Prieur @@ -45,8 +45,10 @@ There are two steps in using signs: When signs are defined for a file, Vim will automatically add a column of two characters to display them in. When the last sign is unplaced the column -disappears again. The color of the column is set with the SignColumn group -|hl-SignColumn|. Example to set the color: > +disappears again. This behavior can be changed with the 'signcolumn' option. + +The color of the column is set with the SignColumn group |hl-SignColumn|. +Example to set the color: > :highlight SignColumn guibg=darkgrey diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 2f8f3acfc1..c7a67e8cfc 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.4. Last change: 2016 May 28 +*syntax.txt* For Vim version 7.4. Last change: 2016 Aug 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -949,6 +949,8 @@ Variable Highlight ~ *c_no_bracket_error* don't highlight {}; inside [] as errors *c_no_curly_error* don't highlight {}; inside [] and () as errors; except { and } in first column + Default is to highlight them, otherwise you + can't spot a missing ")". *c_curly_error* highlight a missing }; this forces syncing from the start of the file, can be slow *c_no_ansi* don't do standard ANSI types and constants @@ -3762,7 +3764,7 @@ Whether or not it is actually concealed depends on the value of the 'conceallevel' option. The 'concealcursor' option is used to decide whether concealable items in the current line are displayed unconcealed to be able to edit the line. -Another way to conceal text with with |matchadd()|. +Another way to conceal text is with |matchadd()|. concealends *:syn-concealends* @@ -4868,6 +4870,9 @@ DiffChange diff mode: Changed line |diff.txt| DiffDelete diff mode: Deleted line |diff.txt| *hl-DiffText* DiffText diff mode: Changed text within a changed line |diff.txt| + *hl-EndOfBuffer* +EndOfBuffer filler lines (~) after the last line in the buffer. + By default, this is highlighted like |hl-NonText|. *hl-ErrorMsg* ErrorMsg error messages on the command line *hl-VertSplit* @@ -4896,10 +4901,10 @@ ModeMsg 'showmode' message (e.g., "-- INSERT --") *hl-MoreMsg* MoreMsg |more-prompt| *hl-NonText* -NonText '~' and '@' at the end of the window, characters from - 'showbreak' and other characters that do not really exist in - the text (e.g., ">" displayed when a double-wide character - doesn't fit at the end of the line). +NonText '@' at the end of the window, characters from 'showbreak' + and other characters that do not really exist in the text + (e.g., ">" displayed when a double-wide character doesn't + fit at the end of the line). *hl-Normal* Normal normal text *hl-Pmenu* diff --git a/runtime/doc/tags b/runtime/doc/tags index ccfbe4faf2..1e934e782f 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -820,6 +820,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* 'sbr' options.txt /*'sbr'* 'sc' options.txt /*'sc'* 'scb' options.txt /*'scb'* +'scl' options.txt /*'scl'* 'scr' options.txt /*'scr'* 'scroll' options.txt /*'scroll'* 'scrollbind' options.txt /*'scrollbind'* @@ -862,6 +863,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX* 'si' options.txt /*'si'* 'sidescroll' options.txt /*'sidescroll'* 'sidescrolloff' options.txt /*'sidescrolloff'* +'signcolumn' options.txt /*'signcolumn'* 'siso' options.txt /*'siso'* 'sj' options.txt /*'sj'* 'slm' options.txt /*'slm'* @@ -6450,6 +6452,7 @@ gdb debug.txt /*gdb* ge motion.txt /*ge* get() eval.txt /*get()* get-ms-debuggers debug.txt /*get-ms-debuggers* +getbufinfo() eval.txt /*getbufinfo()* getbufline() eval.txt /*getbufline()* getbufvar() eval.txt /*getbufvar()* getchar() eval.txt /*getchar()* @@ -6482,8 +6485,10 @@ getscript-data pi_getscript.txt /*getscript-data* getscript-history pi_getscript.txt /*getscript-history* getscript-plugins pi_getscript.txt /*getscript-plugins* getscript-start pi_getscript.txt /*getscript-start* +gettabinfo() eval.txt /*gettabinfo()* gettabvar() eval.txt /*gettabvar()* gettabwinvar() eval.txt /*gettabwinvar()* +getwininfo() eval.txt /*getwininfo()* getwinposx() eval.txt /*getwinposx()* getwinposy() eval.txt /*getwinposy()* getwinvar() eval.txt /*getwinvar()* @@ -6692,6 +6697,7 @@ hl-DiffChange syntax.txt /*hl-DiffChange* hl-DiffDelete syntax.txt /*hl-DiffDelete* hl-DiffText syntax.txt /*hl-DiffText* hl-Directory syntax.txt /*hl-Directory* +hl-EndOfBuffer syntax.txt /*hl-EndOfBuffer* hl-ErrorMsg syntax.txt /*hl-ErrorMsg* hl-FoldColumn syntax.txt /*hl-FoldColumn* hl-Folded syntax.txt /*hl-Folded* @@ -7679,6 +7685,7 @@ new-search-path version6.txt /*new-search-path* new-searchpat version6.txt /*new-searchpat* new-session-files version5.txt /*new-session-files* new-spell version7.txt /*new-spell* +new-style-testing eval.txt /*new-style-testing* new-tab-pages version7.txt /*new-tab-pages* new-undo-branches version7.txt /*new-undo-branches* new-unlisted-buffers version6.txt /*new-unlisted-buffers* @@ -7723,6 +7730,7 @@ octal eval.txt /*octal* octal-nrformats options.txt /*octal-nrformats* octal-number eval.txt /*octal-number* odbeditor gui_mac.txt /*odbeditor* +old-style-testing eval.txt /*old-style-testing* oldfiles-variable eval.txt /*oldfiles-variable* ole-activation if_ole.txt /*ole-activation* ole-eval if_ole.txt /*ole-eval* @@ -8535,11 +8543,11 @@ t_ZH term.txt /*t_ZH* t_ZR term.txt /*t_ZR* t_al term.txt /*t_al* t_bc term.txt /*t_bc* -t_bool-varialble eval.txt /*t_bool-varialble* +t_bool-variable eval.txt /*t_bool-variable* t_cd term.txt /*t_cd* t_cdl version4.txt /*t_cdl* t_ce term.txt /*t_ce* -t_channel-varialble eval.txt /*t_channel-varialble* +t_channel-variable eval.txt /*t_channel-variable* t_ci version4.txt /*t_ci* t_cil version4.txt /*t_cil* t_cl term.txt /*t_cl* @@ -8551,7 +8559,7 @@ t_cv version4.txt /*t_cv* t_cvv version4.txt /*t_cvv* t_da term.txt /*t_da* t_db term.txt /*t_db* -t_dict-varialble eval.txt /*t_dict-varialble* +t_dict-variable eval.txt /*t_dict-variable* t_dl term.txt /*t_dl* t_ed version4.txt /*t_ed* t_el version4.txt /*t_el* @@ -8565,12 +8573,12 @@ t_f6 version4.txt /*t_f6* t_f7 version4.txt /*t_f7* t_f8 version4.txt /*t_f8* t_f9 version4.txt /*t_f9* -t_float-varialble eval.txt /*t_float-varialble* +t_float-variable eval.txt /*t_float-variable* t_fs term.txt /*t_fs* -t_func-varialble eval.txt /*t_func-varialble* +t_func-variable eval.txt /*t_func-variable* t_help version4.txt /*t_help* t_il version4.txt /*t_il* -t_job-varialble eval.txt /*t_job-varialble* +t_job-variable eval.txt /*t_job-variable* t_k1 term.txt /*t_k1* t_k2 term.txt /*t_k2* t_k3 term.txt /*t_k3* @@ -8595,15 +8603,15 @@ t_kr term.txt /*t_kr* t_ks term.txt /*t_ks* t_ku term.txt /*t_ku* t_le term.txt /*t_le* -t_list-varialble eval.txt /*t_list-varialble* +t_list-variable eval.txt /*t_list-variable* t_mb term.txt /*t_mb* t_md term.txt /*t_md* t_me term.txt /*t_me* t_mr term.txt /*t_mr* t_ms term.txt /*t_ms* t_nd term.txt /*t_nd* -t_none-varialble eval.txt /*t_none-varialble* -t_number-varialble eval.txt /*t_number-varialble* +t_none-variable eval.txt /*t_none-variable* +t_number-variable eval.txt /*t_number-variable* t_op term.txt /*t_op* t_se term.txt /*t_se* t_sf1 version4.txt /*t_sf1* @@ -8623,7 +8631,7 @@ t_sku version4.txt /*t_sku* t_so term.txt /*t_so* t_sr term.txt /*t_sr* t_star7 term.txt /*t_star7* -t_string-varialble eval.txt /*t_string-varialble* +t_string-variable eval.txt /*t_string-variable* t_tb version4.txt /*t_tb* t_te term.txt /*t_te* t_ti term.txt /*t_ti* @@ -8767,6 +8775,7 @@ test_null_list() eval.txt /*test_null_list()* test_null_partial() eval.txt /*test_null_partial()* test_null_string() eval.txt /*test_null_string()* test_settime() eval.txt /*test_settime()* +testing eval.txt /*testing* testing-variable eval.txt /*testing-variable* tex-cchar syntax.txt /*tex-cchar* tex-cole syntax.txt /*tex-cole* @@ -8797,9 +8806,14 @@ throw-from-catch eval.txt /*throw-from-catch* throw-variables eval.txt /*throw-variables* throwpoint-variable eval.txt /*throwpoint-variable* time-functions usr_41.txt /*time-functions* +timer eval.txt /*timer* timer-functions usr_41.txt /*timer-functions* +timer_info() eval.txt /*timer_info()* +timer_pause() eval.txt /*timer_pause()* timer_start() eval.txt /*timer_start()* timer_stop() eval.txt /*timer_stop()* +timer_stopall() eval.txt /*timer_stopall()* +timers eval.txt /*timers* timestamp editing.txt /*timestamp* timestamps editing.txt /*timestamps* tips tips.txt /*tips* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index cdd9eabcd1..23bd4e7dfe 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2016 Aug 02 +*todo.txt* For Vim version 7.4. Last change: 2016 Aug 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,8 +34,6 @@ not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- -Should free_all_functions(void) skip numbered and lambda functions? - +channel: - Channel test fails with Motif. Sometimes kills the X11 server. - When a message in the queue but there is no callback, drop it after a while? @@ -107,9 +105,6 @@ What if there is an invalid character? Should json_encode()/json_decode() restrict recursiveness? Or avoid recursiveness. -Patch to test popupmenu. Fails, possibly due to a bug. -(Christian Brabandt, 2016 Jul 23) - Once .exe with updated installer is available: Add remark to download page about /S and /D options (Ken Takata, 2016 Apr 13) Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases @@ -138,53 +133,18 @@ Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807) Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18) -Do we need some way (option) to show the sign column even when there are no -signs? Patch by Christian Brabandt, 2016 Jul 29. - -Patch to allow setting w:quickfix_title via setqflist() and setloclist() -functions. (Christian Brabandt, 2013 May 8, update May 21) -Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14) -Second one. Update May 22. -Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15. -Updated patch: add an argument to setqflist() and getqflist() for these -extra items: Yegappan, 2016 Jul 30. - -Patch to detect st terminal supporting xterm mouse. (Manuel Schiller, 2016 Aug -2, #963) - Syntax highlighting for messages with RFC3339 timestamp (#946) Did maintainer reply? -Patch to add filtering of the quickfix list. (Yegappan Lakshmanan, 2016 Mar -13, last version) Update June 26, #830. -Instead use a Vim script implementation, invoked from a Vim command. - ml_get errors when reloading file. (Chris Desjardins, 2016 Apr 19) Also with latest version. -Still problems with 'emoji'. See issue #721. Patch 7.4.1697 half-fixes it. -Avoid PLAN_WRITE in windgoto() ? -Should already never use utf-8 chars to position the cursor. - Cannot delete a file with square brackets with delete(). (#696) -No autocommand for when changing directory. Patch from allen haim, 2016 Jun -27, #888 -Justin M Keyes: use "global" or "window" for the pattern. Can add "tab" -later. What if entering a window where ":lcd" was used? - Completion for input() does not expand environment variables. (chdiza, 2016 Jul 25, #948) -Patch to have text objects defined by arbitrary single characters. (Daniel -Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31) -Ben Fritz: problem with 'selection' set to "exclusive". -Updated to current Vim, not quite right yet. (Ben Fritz, 2014 Mar 27) -Updated to current Vim (James McCoy, 2016 Jul 30, #958) -Still a bit of work left. - -Patch to add CTRL-N / CTRL-P while searching. (Christian Brabandt, 2016 Jul -29) +'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9) 's$^$\=capture("s/^//gn")' locks Vim in sandbox mode (#950) Patch by Christian Brabandt, 2016 Jul 27. @@ -198,6 +158,8 @@ Also for ":@.". Patch to make printf() convert to string for %s items. (Ken Takata, 2016 Aug 1) +Patch to add %b to printf(). (Ozaki Kiichi, 2016 Aug 5) + Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925) Patch on issue #728 by Christian Brabandt, 2016 Apr 7. Update with test: Apr 8. @@ -206,6 +168,9 @@ Might be related to: Test 44 fails when [[=A=]] is changed to [[=À=]]. Caused by getcmdline() not handling the 0x80 as a second byte correctly? (Dominique Pelle, 2015 Jun 10) +Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple +times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5) + Patch to add 'topbot' to 'belloff' option. (Coot, 2016 Mar 18, #695) Patch for C syntax HL. (Bradley Garagan, 2016 Apr 17) #763 @@ -213,6 +178,10 @@ Patch for C syntax HL. (Bradley Garagan, 2016 Apr 17) #763 Patch to make matchit work better, respect 'matchpairs'. (Ken Takata, 2016 Mar 25) +Patch to fix that on suckless Terminal mousewheel up does not work. +(Ralph Eastwood, 2013 Nov 25) +Patch for mouse support on suckless Terminal. #971 Manuel Schiller + This does not work: :set cscopequickfix=a- (Linewi, 2015 Jul 12, #914) @@ -245,9 +214,6 @@ Update from Ken Takata, 2016 Jul 17. Patch to improve cscope. (Adrian Kocis, #843) -Patch to add getbufinfo(), gettabinfo() and getwininfo(). (Yegappan -Lakshmanan, 2016 Apr 2016) Update Jul 29. #833. - Patch for groovy multi-line comment highlighting. (Justin M. Keyes, 2016 May 20 #644) @@ -265,7 +231,7 @@ No test, needs some work to include. Patch to improve indenting for C++ constructor with initializer list. (Hirohito Higashi, 2016 Mar 31) -After 7.5 is released: +After 8.0 is released: - Drop support for older MS-Windows systems, before XP. Patch from Ken Takata, 2016 Mar 8. @@ -320,6 +286,16 @@ Should use /usr/local/share/applications or /usr/share/applications. Or use $XDG_DATA_DIRS. Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4) +Patch to test popupmenu. Fails, possibly due to a bug. +(Christian Brabandt, 2016 Jul 23) + +Patch to have text objects defined by arbitrary single characters. (Daniel +Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31) +Added tests (James McCoy, 2016 Aug 3). Still needs more work. + +Patch to add CTRL-N / CTRL-P while searching. (Christian Brabandt, 2016 Aug +3) Problem: two matches in one line and using CTRL-P does not move back. + Access to uninitialized memory in match_backref() regexp_nda.c:4882 (Dominique Pelle, 2015 Nov 6) @@ -540,7 +516,7 @@ Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1) Patch for drag&drop reordering of GUI tab pages reordering. (Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe) Now on Git: https://gist.github.com/nocd5/165286495c782b815b94 -Update 2016 Mar 15. +Update 2016 Aug 10. Patch on Issue 72: 'autochdir' causes problems for :vimgrep. @@ -560,9 +536,6 @@ any one-character from the previous line. (Kartik Agaram, 2014 Sep 19) Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21) -Patch to add the EndOfBuffer highlight group, used instead of NonText for "~" -lines. (Marco Hinz, 2014 Nov 2) - Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) Should be easy to highlight all matches with 'incsearch'. Idea by Itchyny, @@ -646,8 +619,7 @@ xterm should be able to pass focus changes to Vim, so that Vim can check for buffers that changed. Perhaps in misc.c, function selectwindow(). Xterm 224 supports it! Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki -Saito, 2013 Apr 24) Has a problem (email 2015 Jan 7). -Update 2015 Jan 10. +Saito, 2013 Apr 24) Update 2016 Aug 12. Also see issue #609. We could add the enable/disable sequences to t_ti/t_te or t_ks/t_ke. @@ -776,9 +748,6 @@ Patch by Thomas Tuegel, also for GTK, 2013 Nov 24 Patch to add funcref to Lua. (Luis Carvalho, 2013 Sep 4) With tests: Sep 5. -Patch to fix that on suckless Terminal mousewheel up does not work. -(Ralph Eastwood, 2013 Nov 25) - Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10) Checking runtime scripts: Thilo Six, 2012 Jun 6. @@ -871,9 +840,6 @@ Improve the installer for MS-Windows. There are a few alternatives: Problem: they all work slightly different (e.g. don't install vimrun.exe). How to test that it works well for all Vim users? -Patch to check whether a buffer is quickfix or a location list. -(Yasuhiro Matsumoto, 2014 Dec 9) - Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec) Issue 54: document behavior of -complete, also expands arg. @@ -1383,7 +1349,7 @@ https://scan.coverity.com/projects/241 Patch to support :undo absolute jump to file save number. (Christian Brabandt, 2010 Nov 5) -Patch to use 'foldnextmax' also for "marker" foldmethod. (Arnaud Lacombe, 2011 +Patch to use 'foldnestmax' also for "marker" foldmethod. (Arnaud Lacombe, 2011 Jan 7) Bug with 'incsearch' going to wrong line. (Wolfram Kresse, 2009 Aug 17) @@ -2452,9 +2418,6 @@ Awaiting updated patches: done for filetype detection. Patch from Walter Briscoe, 2003 Jul 1. 7 Add a "-@ filelist" argument: read file names from a file. (David Kotchan has a patch for it) -8 Include a connection to an external program through a pipe? See - patches from Felbinger for a mathematica interface. - Or use emacs server kind of thing? 7 Add ":justify" command. Patch from Vit Stradal 2002 Nov 25. - findmatch() should be adjusted for Lisp. See remark at get_lisp_indent(). Esp. \( and \) should be skipped. (Dorai Sitaram, diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index b58edb9c0b..db2b986747 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 7.4. Last change: 2016 Jul 24 +*usr_41.txt* For Vim version 7.4. Last change: 2016 Aug 07 VIM USER MANUAL - by Bram Moolenaar @@ -803,6 +803,9 @@ Buffers, windows and the argument list: win_gotoid() go to window with ID win_id2tabwin() get tab and window nr from window ID win_id2win() get window nr from window ID + getbufinfo() get a list with buffer information + gettabinfo() get a list with tab page information + getwininfo() get a list with window information Command line: *command-line-functions* getcmdline() get the current command line @@ -957,7 +960,10 @@ Jobs: *job-functions* Timers: *timer-functions* timer_start() create a timer + timer_pause() pause or unpause a timer timer_stop() stop a timer + timer_stopall() stop all timers + timer_info() get information about timers Various: *various-functions* mode() get current editing mode diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index babaca1eaf..aabf3976c1 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -4028,7 +4028,7 @@ Solution: Check for NULL pointer returned from mch_open(). Files: src/if_cscope.c Patch 7.0.154 -Problem: When 'foldnextmax' is negative Vim can hang. (James Vega) +Problem: When 'foldnestmax' is negative Vim can hang. (James Vega) Solution: Avoid the fold level becoming negative. Files: src/fold.c, src/syntax.c diff --git a/runtime/doc/version8.txt b/runtime/doc/version8.txt index ec9a0db846..b9e6f8b346 100644 --- a/runtime/doc/version8.txt +++ b/runtime/doc/version8.txt @@ -1,24 +1,25 @@ -*version8.txt* For Vim version 8.0. Last change: 2016 Jul 29 +*version8.txt* For Vim version 8.0. Last change: 2016 Aug 16 VIM REFERENCE MANUAL by Bram Moolenaar -NOTE: THIS FILE IS STILL BEING WORKED ON + +NOTE: VIM 8 WAS NOT RELEASED YET, this is work in progress + *vim8* *vim-8* *version-8.0* *version8.0* -Welcome to Vim 8! A large number of bugs have been fixed and several +Welcome to Vim 8! A large number of bugs have been fixed and several nice features have been added. This file mentions all the new items and changes to -existing features since Vim 7.4. Bug fixes, the patches for Vim 7.4, can be -found below |vim-7.4|. Use this command to see the version you are using: > +existing features since Vim 7.4. The patches up to Vim 7.4 can be found here: +|vim-7.4|. + +Use this command to see the full version and features information of the Vim +program you are using: > :version -See |vi_diff.txt| for an overview of differences between Vi and Vim 7.0. -See |version4.txt|, |version5.txt|, |version6.txt| and |version7.txt| for -differences between other versions. - NEW FEATURES |new-8| - -Vim script enhancements |new-vim-script-8| + Vim script enhancements |new-vim-script-8| + Various new items |new-items-8| INCOMPATIBLE CHANGES |incompatible-8| @@ -29,6 +30,10 @@ COMPILE TIME CHANGES |compile-changes-8| PATCHES |patches-8| +See |vi_diff.txt| for an overview of differences between Vi and Vim 8.0. +See |version4.txt|, |version5.txt|, |version6.txt| and |version7.txt| for +differences between other versions. + ============================================================================== NEW FEATURES *new-8* @@ -64,7 +69,7 @@ Also asynchronous are timers. They can fire once or repeatedly and invoke a function to do any work. For example: > let tempTimer = timer_start(4000, 'CheckTemp') This will call the CheckTemp() function four seconds (4000 milli seconds) -later. +later. See |timer_start()|. Partials ~ @@ -128,9 +133,9 @@ The 'breakindent' option has been added to be able to wrap lines without changing the amount of indent. -Windows: Direct-X support ~ +Windows: DirectX support ~ -This adds the 'renderoptions' option to allow for switching on Direct-X +This adds the 'renderoptions' option to allow for switching on DirectX (DirectWrite) support on MS-Windows. @@ -154,15 +159,33 @@ Many functions and commands have been added to support the new types. On some systems the numbers used in Vim script are now 64 bit. This can be checked with the |+num64| feature. +Many items were added so support |new-style-testing|. + Various new items *new-items-8* ----------------- Normal mode commands: ~ +|g+| g+ go to newer text state N times +|g,| g, go to N newer position in change list +|g-| g- go to older text state N times +|g;| g; go to N older position in change list +|g_| g_ cursor to the last CHAR N - 1 lines lower + + +Visual mode commands: ~ + +|v_CTRL-A| CTRL-A add N to number in highlighted text +|v_CTRL-X| CTRL-X subtract N from number in highlighted text +|v_g_CTRL-A| g CTRL-A add N to number in highlighted text +|v_g_CTRL-X| g CTRL-X subtract N from number in highlighted text + Insert mode commands: ~ +|i_CTRL-G_U| CTRL-G U don't break undo with next cursor movement + Options: ~ @@ -177,12 +200,14 @@ Options: ~ 'perldll' name of the Perl dynamic library 'pythondll' name of the Python 2 dynamic library 'pythonthreedll' name of the Python 3 dynamic library +'signcolumn' when to display the sign column 'renderoptions' options for text rendering on Windows 'rubydll' name of the Ruby dynamic library 'tagcase' how to handle case when searching in tags files 'tcldll' name of the Tcl dynamic library 'termguicolors' use GUI colors for the terminal + Ex commands: ~ |:cbottom| scroll to the bottom of the quickfix window @@ -191,7 +216,6 @@ Ex commands: ~ |:chistory| display quickfix list stack |:clearjumps| clear the jump list |:helpclose| close one help window -|:keeppatterns| following command keeps search pattern history |:lbottom| scroll to the bottom of the location window |:ldo| execute command in valid location list entries |:lfdo| execute command in each file in location list @@ -201,10 +225,10 @@ Ex commands: ~ |:packloadall| load all packages under 'packpath' |:smile| make the user happy + Ex command modifiers: ~ - -Ex command arguments: ~ +|:keeppatterns| following command keeps search pattern history New and extended functions: ~ @@ -238,10 +262,14 @@ New and extended functions: ~ |ch_status()| get status of a channel |execute()| execute an Ex command and get the output |exepath()| full path of an executable program +|funcref()| return a reference to function {name} +|getbufinfo()| get a list with buffer information |getcharsearch()| return character search information |getcmdwintype()| return the current command-line window type |getcompletion()| return a list of command-line completion matches |getcurpos()| get position of the cursor +|gettabinfo()| get a list with tab page information +|getwininfo()| get a list with window information |glob2regpat()| convert a glob pattern into a search pattern |isnan()| check for not a number |job_getchannel()| get the channel used by a job @@ -274,8 +302,11 @@ New and extended functions: ~ |test_null_partial()| return a null Partial function |test_null_string()| return a null String |test_settime()| set the time Vim uses internally +|timer_info()| get information about timers +|timer_pause()| pause or unpause a timer |timer_start()| create a timer |timer_stop()| stop a timer +|timer_stopall()| stop all timers |uniq()| remove copies of repeated adjacent items |win_findbuf()| find windows containing a buffer |win_getid()| get window ID of a window @@ -288,29 +319,96 @@ New and extended functions: ~ New Vim variables: ~ |v:vim_did_enter| Set when VimEnter autocommands are triggered +|v:beval_winid| Window ID of the window where the mouse pointer is +|v:completed_item| complete items for the most recently completed word +|v:errors| errors found by assert functions +|v:false| a Number with value zero +|v:hlsearch| indicates whether search highlighting is on +|v:mouse_winid| Window ID for a mouse click obtained with |getchar()| +|v:none| an empty String, used for JSON +|v:null| an empty String, used for JSON +|v:option_new| new value of the option, used by |OptionSet| +|v:option_old| old value of the option, used by |OptionSet| +|v:option_type| scope of the set command, used by |OptionSet| +|v:progpath| the command with which Vim was invoked +|v:t_bool| value of Boolean type +|v:t_channel| value of Channel type +|v:t_dict| value of Dictionary type +|v:t_float| value of Float type +|v:t_func| value of Funcref type +|v:t_job| value of Job type +|v:t_list| value of List type +|v:t_none| value of None type +|v:t_number| value of Number type +|v:t_string| value of String type +|v:testing| must be set before using `test_garbagecollect_now()` +|v:true| a Number with value one +|v:vim_did_enter| zero until most of startup is done New autocommand events: ~ +|CmdUndefined| a user command is used but it isn't defined +|OptionSet| after setting any option +|TabClosed| after closing a tab page +|TabNew| after creating a new tab page +|TextChangedI| after a change was made to the text in Insert mode +|TextChanged| after a change was made to the text in Normal mode +|WinNew| after creating a new window New highlight groups: ~ +EndOfBuffer filler lines (~) after the last line in the buffer. + |hl-EndOfBuffer| + New items in search patterns: ~ +|/\%C| \%C match any composing characters + New Syntax/Indent/FTplugin files: ~ +AVR Assembler (Avra) syntax +Arduino syntax +Bazel syntax and indent and ftplugin +Dockerfile syntax and ftplugin +Eiffel ftplugin +Euphoria 3 and 4 syntax +Go syntax and indent and ftplugin +Godoc syntax +Groovy ftplugin +HGcommit ftplugin +Hog indent and ftplugin +Innovation Data Processing upstream.pt syntax +J syntax and indent and ftplugin +Jproperties ftplugin +Json syntax and indent and ftplugin +Kivy syntax +Less syntax and indent +Mix syntax +Motorola S-Record syntax +R ftplugin +ReStructuredText syntax and indent and ftplugin +Registry ftplugin +Rhelp indent and ftplugin +Rmd (markdown with R code chunks) syntax and indent +Rmd ftplugin +Rnoweb ftplugin +Rnoweb indent +SystemVerilog syntax and indent and ftplugin +Systemd syntax and indent and ftplugin +Teraterm (TTL) syntax and indent +Text ftplugin +Vroom syntax and indent and ftplugin + New Keymaps: ~ - -New message translations: ~ - - -Others: ~ - +Armenian eastern and western +Russian jcukenwintype +Vietnamese telex and vni ============================================================================== INCOMPATIBLE CHANGES *incompatible-8* @@ -318,23 +416,33 @@ INCOMPATIBLE CHANGES *incompatible-8* These changes are incompatible with previous releases. Check this list if you run into a problem when upgrading from Vim 7.4 to 8.0. + +Better defaults without a vimrc ~ + When no vimrc file is found, the |defaults.vim| script is loaded to set more useful default values for new users. That includes setting 'nocompatible'. Thus Vim no longer starts up in Vi compatible mode. If you do want that, either create a .vimrc file that does "set compatible" or start Vim with "Vim -C". + +Support removed ~ + The support for MS-DOS has been removed. It hasn't been working for a while -and removing it cleans up the code quite a bit. +(Vim doesn't fit in memory) and removing it cleans up the code quite a bit. The support for Windows 16 bit (Windows 95 and older) has been removed. -Minor incompatibilities: - -For filetype detection: ... +The support for OS/2 has been removed. It probably hasn't been working for a +while since nobody uses it. The SNiFF+ support has been removed. + +Minor incompatibilities: ~ + +Probably... + ============================================================================== IMPROVEMENTS *improvements-8* @@ -346,8 +454,13 @@ usage. See 'cryptmethod'. ============================================================================== COMPILE TIME CHANGES *compile-changes-8* -Dropped the support for MS-DOS. It was too big to fit in memory. +The Vim repository was moved from Google code to github, since Google code +was shut down. It can now be found at https://github.com/vim/vim. +Functions now use ANSI-C declarations. At least a C-89 compatible compiler is +required. + +The +visual feature is now always included. ============================================================================== PATCHES *patches-8* *bug-fixes-8* @@ -598,7 +711,7 @@ Solution: Move when VIsual_active is reset. (Christian Brabandt) Files: src/ops.c Patch 7.4.042 -Problem: When using ":setlocal" for 'spell' and 'spellang' then :spelldump +Problem: When using ":setlocal" for 'spell' and 'spelllang' then :spelldump doesn't work. (Dimitar Dimitrov) Solution: Copy the option variables to the new window used to show the dump. (Christian Brabandt) @@ -777,7 +890,7 @@ Files: src/edit.c, src/misc1.c, src/proto/misc1.pro Patch 7.4.072 Problem: Crash when using Insert mode completion. -Solution: Avoid going past the end of pum_array. (idea by Fransisco Lopes) +Solution: Avoid going past the end of pum_array. (idea by Francisco Lopes) Files: src/popupmnu.c Patch 7.4.073 @@ -1416,7 +1529,7 @@ Files: src/configure.in, src/auto/configure Patch 7.4.183 Problem: MSVC Visual Studio update not supported. -Solution: Add version number. (Mike William) +Solution: Add version number. (Mike Williams) Files: src/Make_mvc.mak Patch 7.4.184 @@ -2143,7 +2256,7 @@ Files: src/screen.c Patch 7.4.303 Problem: When using double-width characters the text displayed on the command line is sometimes truncated. -Solution: Reset the string lenght. (Nobuhiro Takasaki) +Solution: Reset the string length. (Nobuhiro Takasaki) Files: src/screen.c Patch 7.4.304 @@ -2684,7 +2797,7 @@ Patch 7.4.393 Problem: Text drawing on newer MS-Windows systems is suboptimal. Some multi-byte characters are not displayed, even though the same font in Notepad can display them. (Srinath Avadhanula) -Solution: Add the 'renderoptions' option to enable Direct-X drawing. (Taro +Solution: Add the 'renderoptions' option to enable DirectX drawing. (Taro Muraoka) Files: runtime/doc/eval.txt, runtime/doc/options.txt, runtime/doc/various.txt, src/Make_cyg.mak, src/Make_ming.mak, @@ -5150,7 +5263,7 @@ Files: src/buffer.c Patch 7.4.806 Problem: CTRL-A in Visual mode doesn't work properly with "alpha" in - 'nrformat'. + 'nrformats'. Solution: Make it work. (Christian Brabandt) Files: src/ops.c, src/testdir/test_increment.in, src/testdir/test_increment.ok @@ -6079,7 +6192,7 @@ Files: src/fileio.c Patch 7.4.966 Problem: Configure doesn't work with a space in a path. -Solution: Put paths in quotes. (James McCoy, close #525) +Solution: Put paths in quotes. (James McCoy, closes #525) Files: src/configure.in, src/auto/configure Patch 7.4.967 @@ -6458,7 +6571,7 @@ Files: src/testdir/Make_ming.mak, src/testdir/Make_dos.mak Patch 7.4.1027 Problem: No support for binary numbers. -Solution: Add "bin" to nrformats. (Jason Schulz) +Solution: Add "bin" to 'nrformats'. (Jason Schulz) Files: runtime/doc/change.txt, runtime/doc/eval.txt, runtime/doc/version7.txt, src/charset.c, src/eval.c, src/ex_cmds.c, src/ex_getln.c, src/misc2.c, src/ops.c, @@ -6548,7 +6661,7 @@ Patch 7.4.1041 Problem: Various small things. Solution: Add file to list of distributed files. Adjust README. Fix typo. Files: Filelist, src/testdir/README.txt, src/testdir/test_charsearch.in, - src/INSTALLMac.txt + src/INSTALLmac.txt Patch 7.4.1042 Problem: g-CTRL-G shows the word count, but there is no way to get the word @@ -6948,7 +7061,7 @@ Files: src/testdir/test27.in, src/testdir/test27.ok, Patch 7.4.1109 (after 7.4.1107) Problem: MS-Windows doesn't have rmdir(). Solution: Add mch_rmdir(). -Files: src/os_win32.c, src/proto/os_win32/pro +Files: src/os_win32.c, src/proto/os_win32.pro Patch 7.4.1110 Problem: Test 108 fails when language is French. @@ -8116,7 +8229,7 @@ Files: src/testdir/test_channel.vim Patch 7.4.1299 Problem: When the server sends a message with ID zero the channel handler - is not invoked. (Christian J. Robinson) + is not invoked. (Christian J. Robinson) Solution: Recognize zero value for the request ID. Add a test for invoking the channel handler. Files: src/channel.c, src/testdir/test_channel.vim, @@ -8157,7 +8270,7 @@ Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test36.in, Patch 7.4.1306 Problem: Job control doesn't work well on MS-Windows. -Solution: Various fixes. (Ken Takata, Ozaki Kiichi , Yukihiro Nakadaira, +Solution: Various fixes. (Ken Takata, Ozaki Kiichi, Yukihiro Nakadaira, Yasuhiro Matsumoto) Files: src/Make_mvc.mak, src/eval.c, src/os_unix.c, src/os_win32.c, src/proto/os_unix.pro, src/proto/os_win32.pro, src/structs.h @@ -8502,7 +8615,7 @@ Files: src/testdir/runtest.vim Patch 7.4.1366 Problem: Typo in test and resulting error in test result. -Solution: Fix the typo and correct the result. (James McCoy, close #650) +Solution: Fix the typo and correct the result. (James McCoy, closes #650) Files: src/testdir/test_charsearch.in, src/testdir/test_charsearch.ok Patch 7.4.1367 @@ -9251,7 +9364,7 @@ Patch 7.4.1495 Problem: Compiler warnings when building on Unix with the job feature but without the channel feature. Solution: Move #ifdefs. (Dominique Pelle) -Files: src/os_unxic. +Files: src/os_unix.c Patch 7.4.1496 Problem: Crash when built with GUI but it's not active. (Dominique Pelle) @@ -11132,7 +11245,7 @@ Files: src/quickfix.c Patch 7.4.1824 Problem: When a job is no longer referenced and does not have an exit - callback the process may hang around in defunc state. (Nicola) + callback the process may hang around in defunct state. (Nicola) Solution: Call job_status() if the job is running and won't get freed because it might still be useful. Files: src/channel.c @@ -11289,7 +11402,7 @@ Solution: Unregister the channel when there is an input error. Files: src/channel.c Patch 7.4.1851 -Problem: test_syn_attr failes when using the GUI. (Dominique Pelle) +Problem: test_syn_attr fails when using the GUI. (Dominique Pelle) Solution: Escape the font name properly. Files: src/testdir/test_syn_attr.vim @@ -11349,7 +11462,7 @@ Files: src/testdir/test_timers.vim, src/eval.c, src/ex_cmds2.c, Patch 7.4.1861 Problem: Compiler warnings with 64 bit compiler. -Solution: Change int to size_t. (Mike William) +Solution: Change int to size_t. (Mike Williams) Files: src/ex_cmds2.c Patch 7.4.1862 @@ -11609,7 +11722,7 @@ Files: src/ex_cmds.c Patch 7.4.1906 Problem: Collapsing channel buffers and searching for NL does not work - properly. (Xavier de Gary, Ramel Eshed) + properly. (Xavier de Gaye, Ramel Eshed) Solution: Do not assume the buffer contains a NUL or not. Change NUL bytes to NL to avoid the string is truncated. Files: src/channel.c, src/netbeans.c, src/proto/channel.pro @@ -11699,7 +11812,7 @@ Files: src/ex_cmds.c Patch 7.4.1922 Problem: Ruby 2.4.0 unifies Fixnum and Bignum into Integer. -Solution: Use rb_cInteger. (Weiong Mao) +Solution: Use rb_cInteger. (Weiyong Mao) Files: src/if_ruby.c Patch 7.4.1923 @@ -12499,6 +12612,1565 @@ Solution: Move Dictionary functions to dict.c Files: src/eval.c, src/dict.c, src/vim.h, src/globals.h, src/proto/eval.pro, src/proto/dict.pro, src/Makefile, Filelist -[MORE COMING!] +Patch 7.4.2056 (after 7.4.2055) +Problem: Build fails. +Solution: Add missing changes. +Files: src/proto.h + +Patch 7.4.2057 +Problem: eval.c is too big. +Solution: Move List functions to list.c +Files: src/eval.c, src/dict.c, src/list.c, src/proto.h, src/Makefile, + src/globals.h, src/proto/eval.pro, src/proto/list.pro, Filelist + +Patch 7.4.2058 +Problem: eval.c is too big. +Solution: Move user functions to userfunc.c +Files: src/userfunc.c, src/eval.c, src/vim.h, src/globals.h, + src/structs.h, src/proto.h, src/Makefile, src/proto/eval.pro, + src/proto/userfunc.pro, Filelist + +Patch 7.4.2059 +Problem: Non-Unix builds fail. +Solution: Update Makefiles for new files. +Files: src/Make_bc5.mak, src/Make_cyg_ming.mak, src/Make_dice.mak, + src/Make_ivc.mak, src/Make_manx.mak, src/Make_morph.mak, + src/Make_mvc.mak, src/Make_sas.mak + +Patch 7.4.2060 (after 7.4.2059) +Problem: Wrong file name. +Solution: Fix typo. +Files: src/Make_mvc.mak + +Patch 7.4.2061 +Problem: qf_init_ext() is too big. +Solution: Move code to qf_parse_line() (Yegappan Lakshmanan) +Files: src/quickfix.c, src/testdir/test_quickfix.vim + +Patch 7.4.2062 +Problem: Using dummy variable to compute struct member offset. +Solution: Use offsetof(). +Files: src/globals.h, src/macros.h, src/vim.h, src/spell.c + +Patch 7.4.2063 +Problem: eval.c is still too big. +Solution: Split off internal functions to evalfunc.c. +Files: src/eval.c, src/evalfunc.c, src/list.c, src/proto.h, + src/globals.h, src/vim.h, src/proto/eval.pro, + src/proto/evalfunc.pro, src/proto/list.pro, src/Makefile, Filelist, + src/Make_bc5.mak, src/Make_cyg_ming.mak, src/Make_dice.mak, + src/Make_ivc.mak, src/Make_manx.mak, src/Make_morph.mak, + src/Make_mvc.mak, src/Make_sas.mak + +Patch 7.4.2064 +Problem: Coverity warns for possible buffer overflow. +Solution: Use vim_strcat() instead of strcat(). +Files: src/quickfix.c + +Patch 7.4.2065 +Problem: Compiler warns for uninitialzed variable. (John Marriott) +Solution: Set lnum to the right value. +Files: src/evalfunc.c + +Patch 7.4.2066 +Problem: getcompletion() not well tested. +Solution: Add more testing. +Files: src/testdir/test_cmdline.vim + +Patch 7.4.2067 +Problem: Compiler warning for char/char_u conversion. (Tony Mechelynck) + Inefficient code. +Solution: Use more lines to fill with spaces. (Nikolai Pavlov) Add type cast. +Files: src/quickfix.c + +Patch 7.4.2068 +Problem: Not all arguments of trunc_string() are tested. Memory access + error when running the message tests. +Solution: Add another test case. (Yegappan Lakshmanan) Make it easy to run + unittests with valgrind. Fix the access error. +Files: src/message.c, src/message_test.c, src/Makefile + +Patch 7.4.2069 +Problem: spell.c is too big. +Solution: Split it in spell file handling and spell checking. +Files: src/spell.c, src/spellfile.c, src/spell.h, src/Makefile, + src/proto/spell.pro, src/proto/spellfile.pro, src/proto.h + Filelist, src/Make_bc5.mak, src/Make_cyg_ming.mak, + src/Make_dice.mak, src/Make_ivc.mak, src/Make_manx.mak, + src/Make_morph.mak, src/Make_mvc.mak, src/Make_sas.mak + +Patch 7.4.2070 (after 7.4.2069) +Problem: Missing change to include file. +Solution: Include the spell header file. +Files: src/vim.h + +Patch 7.4.2071 +Problem: The return value of type() is difficult to use. +Solution: Define v:t_ constants. (Ken Takata) +Files: runtime/doc/eval.txt, src/eval.c, src/evalfunc.c, + src/testdir/test_channel.vim, src/testdir/test_viml.vim, src/vim.h + +Patch 7.4.2072 +Problem: substitute() does not support a Funcref argument. +Solution: Support a Funcref like it supports a string starting with "\=". +Files: src/evalfunc.c, src/regexp.c, src/eval.c, src/proto/eval.pro, + src/proto/regexp.pro, src/testdir/test_expr.vim + +Patch 7.4.2073 +Problem: rgb.txt is read for every color name. +Solution: Load rgb.txt once. (Christian Brabandt) Add a test. +Files: runtime/rgb.txt, src/term.c, src/testdir/test_syn_attr.vim + +Patch 7.4.2074 +Problem: One more place using a dummy variable. +Solution: Use offsetof(). (Ken Takata) +Files: src/userfunc.c + +Patch 7.4.2075 +Problem: No autocommand event to initialize a window or tab page. +Solution: Add WinNew and TabNew events. (partly by Felipe Morales) +Files: src/fileio.c, src/window.c, src/vim.h, + src/testdir/test_autocmd.vim, runtime/doc/autocmd.txt + +Patch 7.4.2076 +Problem: Syntax error when dict has '>' key. +Solution: Check for endchar. (Ken Takata) +Files: src/userfunc.c, src/testdir/test_lambda.vim + +Patch 7.4.2077 +Problem: Cannot update 'tabline' when a tab was closed. +Solution: Add the TabClosed autocmd event. (partly by Felipe Morales) +Files: src/fileio.c, src/window.c, src/vim.h, + src/testdir/test_autocmd.vim, runtime/doc/autocmd.txt + +Patch 7.4.2078 +Problem: Running checks in po directory fails. +Solution: Add colors used in syntax.c to the builtin color table. +Files: src/term.c + +Patch 7.4.2079 +Problem: Netbeans test fails on non-Unix systems. +Solution: Only do the permission check on Unix systems. +Files: src/testdir/test_netbeans.vim + +Patch 7.4.2080 +Problem: When using PERROR() on some systems assert_fails() does not see + the error. +Solution: Make PERROR() always report the error. +Files: src/vim.h, src/message.c, src/proto/message.pro + +Patch 7.4.2081 +Problem: Line numbers in the error list are not always adjusted. +Solution: Set b_has_qf_entry properly. (Yegappan Lakshmanan) +Files: src/quickfix.c, src/structs.h, src/testdir/test_quickfix.vim + +Patch 7.4.2082 +Problem: Not much test coverage for digraphs. +Solution: Add a new style digraph test. (Christian Brabandt) +Files: src/Makefile, src/testdir/test_alot.vim, + src/testdir/test_digraph.vim + +Patch 7.4.2083 +Problem: Coverity complains about not restoring a value. +Solution: Restore the value, although it's not really needed. Change return + to jump to cleanup, might leak memory. +Files: src/userfunc.c + +Patch 7.4.2084 +Problem: New digraph test makes testing hang. +Solution: Don't set "nocp". +Files: src/testdir/test_digraph.vim + +Patch 7.4.2085 +Problem: Digraph tests fails on some systems. +Solution: Run it separately and set 'encoding' early. +Files: src/testdir/Make_all.mak, src/testdir/test_alot.vim, + src/testdir/test_digraph.vim + +Patch 7.4.2086 +Problem: Using the system default encoding makes tests unpredictable. +Solution: Always use utf-8 or latin1 in the new style tests. Remove setting + encoding and scriptencoding where it is not needed. +Files: src/testdir/runtest.vim, src/testdir/test_channel.vim, + src/testdir/test_digraph.vim, src/testdir/test_expand_dllpath.vim, + src/testdir/test_expr_utf8.vim, src/testdir/test_json.vim, + src/testdir/test_matchadd_conceal_utf8.vim, + src/testdir/test_regexp_utf8.vim, src/testdir/test_visual.vim, + src/testdir/test_alot_utf8.vim, + +Patch 7.4.2087 +Problem: Digraph code test coverage is still low. +Solution: Add more tests. (Christian Brabandt) +Files: src/testdir/test_digraph.vim + +Patch 7.4.2088 (after 7.4.2087) +Problem: Keymap test fails with normal features. +Solution: Bail out if the keymap feature is not supported. +Files: src/testdir/test_digraph.vim + +Patch 7.4.2089 +Problem: Color handling of X11 GUIs is too complicated. +Solution: Simplify the code. Use RGBA where appropriate. (Kazunobu + Kuriyama) +Files: src/gui.h, src/gui_beval.c, src/gui_gtk_x11.c, src/netbeans.c + +Patch 7.4.2090 +Problem: Using submatch() in a lambda passed to substitute() is verbose. +Solution: Use a static list and pass it as an optional argument to the + function. Fix memory leak. +Files: src/structs.h, src/list.c, src/userfunc.c, src/channel.c, + src/eval.c, src/evalfunc.c, src/ex_cmds2.c, src/regexp.c, + src/proto/list.pro, src/proto/userfunc.pro, + src/testdir/test_expr.vim, runtime/doc/eval.txt + +Patch 7.4.2091 +Problem: Coverity reports a resource leak when out of memory. +Solution: Close the file before returning. +Files: src/term.c + +Patch 7.4.2092 +Problem: GTK 3 build fails with older GTK version. +Solution: Check the pango version. (Kazunobu Kuriyama) +Files: src/gui_beval.c + +Patch 7.4.2093 +Problem: Netbeans test fails once in a while. Leaving log file behind. +Solution: Add it to the list of flaky tests. Disable logfile. +Files: src/testdir/runtest.vim, src/testdir/test_channel.vim + +Patch 7.4.2094 +Problem: The color allocation in X11 is overly complicated. +Solution: Remove find_closest_color(), XAllocColor() already does this. + (Kazunobu Kuriyama) +Files: src/gui_x11.c + +Patch 7.4.2095 +Problem: Man test fails when run with the GUI. +Solution: Adjust for different behavior of GUI. Add assert_inrange(). +Files: src/eval.c, src/evalfunc.c, src/proto/eval.pro, + src/testdir/test_assert.vim, src/testdir/test_man.vim, + runtime/doc/eval.txt + +Patch 7.4.2096 +Problem: Lambda functions show up with completion. +Solution: Don't show lambda functions. (Ken Takata) +Files: src/userfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2097 +Problem: Warning from 64 bit compiler. +Solution: use size_t instead of int. (Mike Williams) +Files: src/message.c + +Patch 7.4.2098 +Problem: Text object tests are old style. +Solution: Turn them into new style tests. (James McCoy, closes #941) +Files: src/testdir/Make_all.mak, src/testdir/test_textobjects.in, + src/testdir/test_textobjects.ok, src/testdir/test_textobjects.vim, + src/Makefile + +Patch 7.4.2099 +Problem: When a keymap is active only "(lang)" is displayed. (Ilya + Dogolazky) +Solution: Show the keymap name. (Dmitri Vereshchagin, closes #933) +Files: src/buffer.c, src/proto/screen.pro, src/screen.c + +Patch 7.4.2100 +Problem: "cgn" and "dgn" do not work correctly with a single character + match and the replacement includes the searched pattern. (John + Beckett) +Solution: If the match is found in the wrong column try in the next column. + Turn the test into new style. (Christian Brabandt) +Files: src/search.c, src/testdir/Make_all.mak, src/Makefile, + src/testdir/test53.in, src/testdir/test53.ok, + src/testdir/test_gn.vim + +Patch 7.4.2101 +Problem: Looping over windows, buffers and tab pages is inconsistent. +Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan) +Files: src/buffer.c, src/diff.c, src/edit.c, src/eval.c, src/evalfunc.c, + src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/fileio.c, + src/globals.h, src/gui.c, src/gui_mac.c, src/if_lua.c, + src/if_mzsch.c, src/if_perl.xs, src/if_ruby.c, src/if_tcl.c, + src/main.c, src/mark.c, src/memfile.c, src/memline.c, src/misc1.c, + src/move.c, src/netbeans.c, src/normal.c, src/option.c, + src/quickfix.c, src/screen.c, src/spell.c, src/term.c, + src/window.c, src/workshop.c + +Patch 7.4.2102 (after 7.4.2101) +Problem: Tiny build with GUI fails. +Solution: Revert one FOR_ALL_ change. +Files: src/gui.c + +Patch 7.4.2103 +Problem: Can't have "augroup END" right after ":au!". +Solution: Check for the bar character before the command argument. +Files: src/fileio.c, src/testdir/test_autocmd.vim, + runtime/doc/autocmd.txt + +Patch 7.4.2104 +Problem: Code duplication when unreferencing a function. +Solution: De-duplicate. +Files: src/userfunc.c + +Patch 7.4.2105 +Problem: Configure reports default features to be "normal" while it is + "huge". +Solution: Change the default text. Build with newer autoconf. +Files: src/configure.in, src/auto/configure + +Patch 7.4.2106 +Problem: Clang warns about missing field in initializer. +Solution: Define COMMA and use it. (Kazunobu Kuriyama) +Files: src/ex_cmds.c, src/globals.h, src/vim.h + +Patch 7.4.2107 (after 7.4.2106) +Problem: Misplaced equal sign. +Solution: Remove it. +Files: src/globals.h + +Patch 7.4.2108 +Problem: Netbeans test is flaky. +Solution: Wait for the cursor to be positioned. +Files: src/testdir/test_netbeans.vim + +Patch 7.4.2109 +Problem: Setting 'display' to "lastline" is a drastic change, while + omitting it results in lots of "@" lines. +Solution: Add "truncate" to show "@@@" for a truncated line. +Files: src/option.h, src/screen.c, runtime/doc/options.txt + +Patch 7.4.2110 +Problem: When there is an CmdUndefined autocmd then the error for a missing + command is E464 instead of E492. (Manuel Ortega) +Solution: Don't let the pointer be NULL. +Files: src/ex_docmd.c, src/testdir/test_usercommands.vim + +Patch 7.4.2111 +Problem: Defaults are very conservative. +Solution: Move settings from vimrc_example.vim to defaults.vim. Load + defaults.vim if no .vimrc was found. +Files: src/main.c, src/version.c, src/os_amiga.h, src/os_dos.h, + src/os_mac.h, src/os_unix.h, src/feature.h, src/Makefile, + runtime/vimrc_example.vim, runtime/defaults.vim, + runtime/evim.vim, Filelist, runtime/doc/starting.txt + +Patch 7.4.2112 +Problem: getcompletion(.., 'dir') returns a match with trailing "*" when + there are no matches. (Chdiza) +Solution: Return an empty list when there are no matches. Add a trailing + slash to directories. (Yegappan Lakshmanan) Add tests for no + matches. (closes #947) +Files: src/evalfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2113 +Problem: Test for undo is flaky. +Solution: Turn it into a new style test. Use test_settime() to avoid + flakyness. +Files: src/Makefile, src/undo.c, src/testdir/test61.in, + src/testdir/test61.ok, src/testdir/test_undo.vim, + src/testdir/test_undolevels.vim, src/testdir/Make_all.mak, + src/testdir/test_alot.vim + +Patch 7.4.2114 +Problem: Tiny build fails. +Solution: Always include vim_time(). +Files: src/ex_cmds.c + +Patch 7.4.2115 +Problem: Loading defaults.vim with -C argument. +Solution: Don't load the defaults script with -C argument. Test sourcing + the defaults script. Set 'display' to "truncate". +Files: src/main.c, src/Makefile, runtime/defaults.vim, + src/testdir/test_startup.vim, src/testdir/Make_all.mak + +Patch 7.4.2116 +Problem: The default vimrc for Windows is very conservative. +Solution: Use the defaults.vim in the Windows installer. +Files: src/dosinst.c + +Patch 7.4.2117 +Problem: Deleting an augroup that still has autocmds does not give a + warning. The next defined augroup takes its place. +Solution: Give a warning and prevent the index being used for another group + name. +Files: src/fileio.c, src/testdir/test_autocmd.vim + +Patch 7.4.2118 +Problem: Mac: can't build with tiny features. +Solution: Don't define FEAT_CLIPBOARD unconditionally. (Kazunobu Kuriyama) +Files: src/vim.h + +Patch 7.4.2119 +Problem: Closures are not supported. +Solution: Capture variables in lambdas from the outer scope. (Yasuhiro + Matsumoto, Ken Takata) +Files: runtime/doc/eval.txt, src/eval.c, src/ex_cmds2.c, src/globals.h, + src/proto/eval.pro, src/proto/userfunc.pro, + src/testdir/test_lambda.vim, src/userfunc.c + +Patch 7.4.2120 +Problem: User defined functions can't be a closure. +Solution: Add the "closure" argument. Allow using :unlet on a bound + variable. (Yasuhiro Matsumoto, Ken Takata) +Files: runtime/doc/eval.txt, src/testdir/test_lambda.vim, src/userfunc.c, + src/eval.c src/proto/userfunc.pro + +Patch 7.4.2121 +Problem: No easy way to check if lambda and closure are supported. +Solution: Add the +lambda feature. +Files: src/evalfunc.c, src/version.c, src/testdir/test_lambda.vim + +Patch 7.4.2122 (after 7.4.2118) +Problem: Mac: don't get +clipboard in huge build. +Solution: Move #define down below including feature.h +Files: src/vim.h + +Patch 7.4.2123 +Problem: No new style test for diff mode. +Solution: Add a test. Check that folds are in sync. +Files: src/Makefile, src/testdir/test_diffmode.vim, + src/testdir/Make_all.mak, src/testdir/test47.in, + src/testdir/test47.ok + +Patch 7.4.2124 +Problem: diffmode test leaves files behind, breaking another test. +Solution: Delete the files. +Files: src/testdir/test_diffmode.vim + +Patch 7.4.2125 +Problem: Compiler warning for loss of data. +Solution: Add a type cast. (Christian Brabandt) +Files: src/message.c + +Patch 7.4.2126 +Problem: No tests for :diffget and :diffput +Solution: Add tests. +Files: src/testdir/test_diffmode.vim + +Patch 7.4.2127 +Problem: The short form of ":noswapfile" is ":noswap" instead of ":nos". + (Kent Sibilev) +Solution: Only require three characters. Add a test for the short forms. +Files: src/ex_docmd.c, src/testdir/test_usercommands.vim + +Patch 7.4.2128 +Problem: Memory leak when saving for undo fails. +Solution: Free allocated memory. (Hirohito Higashi) +Files: src/ex_cmds.c + +Patch 7.4.2129 +Problem: Memory leak when using timer_start(). (Dominique Pelle) +Solution: Don't copy the callback when using a partial. +Files: src/evalfunc.c + +Patch 7.4.2130 +Problem: Pending timers cause false memory leak reports. +Solution: Free all timers on exit. +Files: src/ex_cmds2.c, src/proto/ex_cmds2.pro, src/misc2.c + +Patch 7.4.2131 +Problem: More memory leaks when using partial, e.g. for "exit-cb". +Solution: Don't copy the callback when using a partial. +Files: src/channel.c + +Patch 7.4.2132 +Problem: test_partial has memory leaks reported. +Solution: Add a note about why this happens. +Files: src/testdir/test_partial.vim + +Patch 7.4.2133 (after 7.4.2128) +Problem: Can't build with tiny features. +Solution: Add #ifdef. +Files: src/ex_cmds.c + +Patch 7.4.2134 +Problem: No error for using function() badly. +Solution: Check for passing wrong function name. (Ken Takata) +Files: src/eval.c, src/evalfunc.c, src/proto/userfunc.pro, + src/testdir/test_expr.vim, src/userfunc.c, src/vim.h + +Patch 7.4.2135 +Problem: Various tiny issues. +Solution: Update comments, white space, etc. +Files: src/diff.c, src/digraph.c, src/testdir/test80.in, + src/testdir/test_channel.vim, src/testdir/Makefile, + runtime/menu.vim, src/INSTALLpc.txt, src/xpm/README.txt + +Patch 7.4.2136 +Problem: Closure function fails. +Solution: Don't reset uf_scoped when it points to another funccal. +Files: src/userfunc.c, src/testdir/test_lambda.vim + +Patch 7.4.2137 +Problem: Using function() with a name will find another function when it is + redefined. +Solution: Add funcref(). Refer to lambda using a partial. Fix several + reference counting issues. +Files: src/vim.h, src/structs.h, src/userfunc.c, src/eval.c, + src/evalfunc.c, src/channel.c, src/proto/eval.pro, + src/proto/userfunc.pro, src/if_mzsch.c, src/regexp.c, src/misc2.c, + src/if_py_both.h, src/testdir/test_expr.vim, runtime/doc/eval.txt + +Patch 7.4.2138 +Problem: Test 86 and 87 fail. +Solution: Call func_ref() also for regular functions. +Files: src/if_py_both.h + +Patch 7.4.2139 +Problem: :delfunction causes illegal memory access. +Solution: Correct logic when deciding to free a function. +Files: src/userfunc.c, src/testdir/test_lambda.vim + +Patch 7.4.2140 +Problem: Tiny build fails. +Solution: Add dummy typedefs. +Files: src/structs.h + +Patch 7.4.2141 +Problem: Coverity reports bogus NULL check. +Solution: When checking for a variable in the funccal scope don't pass the + varname. +Files: src/userfunc.c, src/proto/userfunc.pro, src/eval.c + +Patch 7.4.2142 +Problem: Leaking memory when redefining a function. +Solution: Don't increment the function reference count when it's found by + name. Don't remove the wrong function from the hashtab. More + reference counting fixes. +Files: src/structs.h, src/userfunc.c + +Patch 7.4.2143 +Problem: A funccal is garbage collected while it can still be used. +Solution: Set copyID in all referenced functions. Do not list lambda + functions with ":function". +Files: src/userfunc.c, src/proto/userfunc.pro, src/eval.c, + src/testdir/test_lambda.vim + +Patch 7.4.2144 +Problem: On MS-Windows quickfix does not handle a line with 1023 bytes + ending in CR-LF properly. +Solution: Don't consider CR a line break. (Ken Takata) +Files: src/quickfix.c + +Patch 7.4.2145 +Problem: Win32: Using CreateThread/ExitThread is not safe. +Solution: Use _beginthreadex and return from the thread. (Ken Takata) +Files: src/os_win32.c + +Patch 7.4.2146 +Problem: Not enough testing for popup menu. CTRL-E does not always work + properly. +Solution: Add more tests. When using CTRL-E check if the popup menu is + visible. (Christian Brabandt) +Files: src/edit.c, src/testdir/test_popup.vim + +Patch 7.4.2147 (after 7.4.2146) +Problem: test_alot fails. +Solution: Close window. +Files: src/testdir/test_popup.vim + +Patch 7.4.2148 +Problem: Not much testing for cscope. +Solution: Add a test that uses the cscope program. (Christian Brabandt) +Files: src/testdir/test_cscope.vim + +Patch 7.4.2149 +Problem: If a test leaves a window open a following test may fail. +Solution: Always close extra windows after running a test. +Files: src/testdir/runtest.vim, src/testdir/test_popup.vim + +Patch 7.4.2150 +Problem: Warning with MinGW 64. (John Marriott) +Solution: Change return type. (Ken Takata) +Files: src/os_win32.c + +Patch 7.4.2151 +Problem: Quickfix test fails on MS-Windows. +Solution: Close the help window. (Christian Brabandt) +Files: src/testdir/test_quickfix.vim + +Patch 7.4.2152 +Problem: No proper translation of messages with a count. +Solution: Use ngettext(). (Sergey Alyoshin) +Files: src/evalfunc.c, src/fold.c, src/os_win32.c, src/screen.c, src/vim.h + +Patch 7.4.2153 +Problem: GUI test isn't testing much. +Solution: Turn into a new style test. Execute a shell command. +Files: src/testdir/test_gui.vim, src/testdir/test16.in, + src/testdir/test16.ok, src/testdir/Make_all.mak, src/Makefile, + src/testdir/Make_vms.mms + +Patch 7.4.2154 +Problem: Test_communicate() fails sometimes. +Solution: Add it to the flaky tests. +Files: src/testdir/runtest.vim + +Patch 7.4.2155 +Problem: Quotes make GUI test fail on MS-Windows. +Solution: Remove quotes, strip white space. +Files: src/testdir/test_gui.vim + +Patch 7.4.2156 +Problem: Compiler warning. +Solution: Add type cast. (Ken Takata, Mike Williams) +Files: src/os_win32.c + +Patch 7.4.2157 +Problem: Test_job_start_fails() is expected to report memory leaks, making + it hard to see other leaks in test_partial. +Solution: Move Test_job_start_fails() to a separate test file. +Files: src/testdir/test_partial.vim, src/testdir/test_job_fails.vim, + src/Makefile, src/testdir/Make_all.mak + +Patch 7.4.2158 +Problem: Result of getcompletion('', 'cscope') depends on previous + completion. (Christian Brabandt) +Solution: Call set_context_in_cscope_cmd(). +Files: src/evalfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2159 +Problem: Insufficient testing for cscope. +Solution: Add more tests. (Dominique Pelle) +Files: src/testdir/test_cscope.vim + +Patch 7.4.2160 +Problem: setmatches() mixes up values. (Nikolai Pavlov) +Solution: Save the string instead of reusing a shared buffer. +Files: src/dict.c, src/evalfunc.c, src/testdir/test_expr.vim, + +Patch 7.4.2161 (after 7.4.2160) +Problem: Expression test fails without conceal feature. +Solution: Only check "conceal" with the conceal feature. +Files: src/testdir/test_expr.vim + +Patch 7.4.2162 +Problem: Result of getcompletion('', 'sign') depends on previous + completion. +Solution: Call set_context_in_sign_cmd(). (Dominique Pelle) +Files: src/evalfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2063 +Problem: eval.c is still too big. +Solution: Split off internal functions to evalfunc.c. +Files: src/eval.c, src/evalfunc.c, src/list.c, src/proto.h, + src/globals.h, src/vim.h, src/proto/eval.pro, + src/proto/evalfunc.pro, src/proto/list.pro, src/Makefile, Filelist, + src/Make_bc5.mak, src/Make_cyg_ming.mak, src/Make_dice.mak, + src/Make_ivc.mak, src/Make_manx.mak, src/Make_morph.mak, + src/Make_mvc.mak, src/Make_sas.mak + +Patch 7.4.2064 +Problem: Coverity warns for possible buffer overflow. +Solution: Use vim_strcat() instead of strcat(). +Files: src/quickfix.c + +Patch 7.4.2065 +Problem: Compiler warns for uninitialzed variable. (John Marriott) +Solution: Set lnum to the right value. +Files: src/evalfunc.c + +Patch 7.4.2066 +Problem: getcompletion() not well tested. +Solution: Add more testing. +Files: src/testdir/test_cmdline.vim + +Patch 7.4.2067 +Problem: Compiler warning for char/char_u conversion. (Tony Mechelynck) + Inefficient code. +Solution: Use more lines to fill with spaces. (Nikolai Pavlov) Add type cast. +Files: src/quickfix.c + +Patch 7.4.2068 +Problem: Not all arguments of trunc_string() are tested. Memory access + error when running the message tests. +Solution: Add another test case. (Yegappan Lakshmanan) Make it easy to run + unittests with valgrind. Fix the access error. +Files: src/message.c, src/message_test.c, src/Makefile + +Patch 7.4.2069 +Problem: spell.c is too big. +Solution: Split it in spell file handling and spell checking. +Files: src/spell.c, src/spellfile.c, src/spell.h, src/Makefile, + src/proto/spell.pro, src/proto/spellfile.pro, src/proto.h + Filelist, src/Make_bc5.mak, src/Make_cyg_ming.mak, + src/Make_dice.mak, src/Make_ivc.mak, src/Make_manx.mak, + src/Make_morph.mak, src/Make_mvc.mak, src/Make_sas.mak + +Patch 7.4.2070 (after 7.4.2069) +Problem: Missing change to include file. +Solution: Include the spell header file. +Files: src/vim.h + +Patch 7.4.2071 +Problem: The return value of type() is difficult to use. +Solution: Define v:t_ constants. (Ken Takata) +Files: runtime/doc/eval.txt, src/eval.c, src/evalfunc.c, + src/testdir/test_channel.vim, src/testdir/test_viml.vim, src/vim.h + +Patch 7.4.2072 +Problem: substitute() does not support a Funcref argument. +Solution: Support a Funcref like it supports a string starting with "\=". +Files: src/evalfunc.c, src/regexp.c, src/eval.c, src/proto/eval.pro, + src/proto/regexp.pro, src/testdir/test_expr.vim + +Patch 7.4.2073 +Problem: rgb.txt is read for every color name. +Solution: Load rgb.txt once. (Christian Brabandt) Add a test. +Files: runtime/rgb.txt, src/term.c, src/testdir/test_syn_attr.vim + +Patch 7.4.2074 +Problem: One more place using a dummy variable. +Solution: Use offsetof(). (Ken Takata) +Files: src/userfunc.c + +Patch 7.4.2075 +Problem: No autocommand event to initialize a window or tab page. +Solution: Add WinNew and TabNew events. (partly by Felipe Morales) +Files: src/fileio.c, src/window.c, src/vim.h, + src/testdir/test_autocmd.vim, runtime/doc/autocmd.txt + +Patch 7.4.2076 +Problem: Syntax error when dict has '>' key. +Solution: Check for endchar. (Ken Takata) +Files: src/userfunc.c, src/testdir/test_lambda.vim + +Patch 7.4.2077 +Problem: Cannot update 'tabline' when a tab was closed. +Solution: Add the TabClosed autocmd event. (partly by Felipe Morales) +Files: src/fileio.c, src/window.c, src/vim.h, + src/testdir/test_autocmd.vim, runtime/doc/autocmd.txt + +Patch 7.4.2078 +Problem: Running checks in po diretory fails. +Solution: Add colors used in syntax.c to the builtiin color table. +Files: src/term.c + +Patch 7.4.2079 +Problem: Netbeans test fails on non-Unix systems. +Solution: Only do the permission check on Unix systems. +Files: src/testdir/test_netbeans.vim + +Patch 7.4.2080 +Problem: When using PERROR() on some systems assert_fails() does not see + the error. +Solution: Make PERROR() always report the error. +Files: src/vim.h, src/message.c, src/proto/message.pro + +Patch 7.4.2081 +Problem: Line numbers in the error list are not always adjusted. +Solution: Set b_has_qf_entry properly. (Yegappan Lakshmanan) +Files: src/quickfix.c, src/structs.h, src/testdir/test_quickfix.vim + +Patch 7.4.2082 +Problem: Not much test coverage for digraphs. +Solution: Add a new style digraph test. (Christian Brabandt) +Files: src/Makefile, src/testdir/test_alot.vim, + src/testdir/test_digraph.vim + +Patch 7.4.2083 +Problem: Coverity complains about not restoring a value. +Solution: Restore the value, although it's not really needed. Change return + to jump to cleanup, might leak memory. +Files: src/userfunc.c + +Patch 7.4.2084 +Problem: New digraph test makes testing hang. +Solution: Don't set "nocp". +Files: src/testdir/test_digraph.vim + +Patch 7.4.2085 +Problem: Digraph tests fails on some systems. +Solution: Run it separately and set 'encoding' early. +Files: src/testdir/Make_all.mak, src/testdir/test_alot.vim, + src/testdir/test_digraph.vim + +Patch 7.4.2086 +Problem: Using the system default encoding makes tests unpredictable. +Solution: Always use utf-8 or latin1 in the new style tests. Remove setting + encoding and scriptencoding where it is not needed. +Files: src/testdir/runtest.vim, src/testdir/test_channel.vim, + src/testdir/test_digraph.vim, src/testdir/test_expand_dllpath.vim, + src/testdir/test_expr_utf8.vim, src/testdir/test_json.vim, + src/testdir/test_matchadd_conceal_utf8.vim, + src/testdir/test_regexp_utf8.vim, src/testdir/test_visual.vim, + src/testdir/test_alot_utf8.vim, + +Patch 7.4.2087 +Problem: Digraph code test coverage is still low. +Solution: Add more tests. (Christian Brabandt) +Files: src/testdir/test_digraph.vim + +Patch 7.4.2088 (after 7.4.2087) +Problem: Keymap test fails with normal features. +Solution: Bail out if the keymap feature is not supported. +Files: src/testdir/test_digraph.vim + +Patch 7.4.2089 +Problem: Color handling of X11 GUIs is too complicated. +Solution: Simplify the code. Use RGBA where appropriate. (Kazunobu + Kuriyama) +Files: src/gui.h, src/gui_beval.c, src/gui_gtk_x11.c, src/netbeans.c + +Patch 7.4.2090 +Problem: Using submatch() in a lambda passed to substitute() is verbose. +Solution: Use a static list and pass it as an optional argument to the + function. Fix memory leak. +Files: src/structs.h, src/list.c, src/userfunc.c, src/channel.c, + src/eval.c, src/evalfunc.c, src/ex_cmds2.c, src/regexp.c, + src/proto/list.pro, src/proto/userfunc.pro, + src/testdir/test_expr.vim, runtime/doc/eval.txt + +Patch 7.4.2091 +Problem: Coverity reports a resource leak when out of memory. +Solution: Close the file before returning. +Files: src/term.c + +Patch 7.4.2092 +Problem: GTK 3 build fails with older GTK version. +Solution: Check the pango version. (Kazunobu Kuriyama) +Files: src/gui_beval.c + +Patch 7.4.2093 +Problem: Netbeans test fails once in a while. Leaving log file behind. +Solution: Add it to the list of flaky tests. Disable logfile. +Files: src/testdir/runtest.vim, src/testdir/test_channel.vim + +Patch 7.4.2094 +Problem: The color allocation in X11 is overly complicated. +Solution: Remove find_closest_color(), XAllocColor() already does this. + (Kazunobu Kuriyama) +Files: src/gui_x11.c + +Patch 7.4.2095 +Problem: Man test fails when run with the GUI. +Solution: Adjust for different behavior of GUI. Add assert_inrange(). +Files: src/eval.c, src/evalfunc.c, src/proto/eval.pro, + src/testdir/test_assert.vim, src/testdir/test_man.vim, + runtime/doc/eval.txt + +Patch 7.4.2096 +Problem: Lambda functions show up with completion. +Solution: Don't show lambda functions. (Ken Takata) +Files: src/userfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2097 +Problem: Warning from 64 bit compiler. +Solution: use size_t instead of int. (Mike Williams) +Files: src/message.c + +Patch 7.4.2098 +Problem: Text object tests are old style. +Solution: Turn them into new style tests. (James McCoy, closes #941) +Files: src/testdir/Make_all.mak, src/testdir/test_textobjects.in, + src/testdir/test_textobjects.ok, src/testdir/test_textobjects.vim, + src/Makefile + +Patch 7.4.2099 +Problem: When a keymap is active only "(lang)" is displayed. (Ilya + Dogolazky) +Solution: Show the keymap name. (Dmitri Vereshchagin, closes #933) +Files: src/buffer.c, src/proto/screen.pro, src/screen.c + +Patch 7.4.2100 +Problem: "cgn" and "dgn" do not work correctly with a single character + match and the replacement includes the searched pattern. (John + Beckett) +Solution: If the match is found in the wrong column try in the next column. + Turn the test into new style. (Christian Brabandt) +Files: src/search.c, src/testdir/Make_all.mak, src/Makefile, + src/testdir/test53.in, src/testdir/test53.ok, + src/testdir/test_gn.vim + +Patch 7.4.2101 +Problem: Looping over windows, buffers and tab pages is inconsistant. +Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan) +Files: src/buffer.c, src/diff.c, src/edit.c, src/eval.c, src/evalfunc.c, + src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/fileio.c, + src/globals.h, src/gui.c, src/gui_mac.c, src/if_lua.c, + src/if_mzsch.c, src/if_perl.xs, src/if_ruby.c, src/if_tcl.c, + src/main.c, src/mark.c, src/memfile.c, src/memline.c, src/misc1.c, + src/move.c, src/netbeans.c, src/normal.c, src/option.c, + src/quickfix.c, src/screen.c, src/spell.c, src/term.c, + src/window.c, src/workshop.c + +Patch 7.4.2102 (after 7.4.2101) +Problem: Tiny build with GUI fails. +Solution: Revert one FOR_ALL_ change. +Files: src/gui.c + +Patch 7.4.2103 +Problem: Can't have "augroup END" right after ":au!". +Solution: Check for the bar character before the command argument. +Files: src/fileio.c, src/testdir/test_autocmd.vim, + runtime/doc/autocmd.txt + +Patch 7.4.2104 +Problem: Code duplication when unreferencing a function. +Solution: De-duplicate. +Files: src/userfunc.c + +Patch 7.4.2105 +Problem: Configure reports default features to be "normal" while it is + "huge". +Solution: Change the default text. Build with newer autoconf. +Files: src/configure.in, src/auto/configure + +Patch 7.4.2106 +Problem: Clang warns about missing field in initializer. +Solution: Define COMMA and use it. (Kazunobu Kuriyama) +Files: src/ex_cmds.c, src/globals.h, src/vim.h + +Patch 7.4.2107 (after 7.4.2106) +Problem: Misplaced equal sign. +Solution: Remove it. +Files: src/globals.h + +Patch 7.4.2108 +Problem: Netbeans test is flaky. +Solution: Wait for the cursor to be positioned. +Files: src/testdir/test_netbeans.vim + +Patch 7.4.2109 +Problem: Setting 'display' to "lastline" is a drastic change, while + omitting it results in lots of "@" lines. +Solution: Add "truncate" to show "@@@" for a truncated line. +Files: src/option.h, src/screen.c, runtime/doc/options.txt + +Patch 7.4.2110 +Problem: When there is an CmdUndefined autocmd then the error for a missing + command is E464 instead of E492. (Manuel Ortega) +Solution: Don't let the pointer be NULL. +Files: src/ex_docmd.c, src/testdir/test_usercommands.vim + +Patch 7.4.2111 +Problem: Defaults are very conservative. +Solution: Move settings from vimrc_example.vim to defaults.vim. Load + defaults.vim if no .vimrc was found. +Files: src/main.c, src/version.c, src/os_amiga.h, src/os_dos.h, + src/os_mac.h, src/os_unix.h, src/feature.h, src/Makefile, + runtime/vimrc_example.vim, runtime/defaults.vim, + runtime/evim.vim, Filelist, runtime/doc/starting.txt + +Patch 7.4.2112 +Problem: getcompletion(.., 'dir') returns a match with trailing "*" when + there are no matches. (Chdiza) +Solution: Return an empty list when there are no matches. Add a trailing + slash to directories. (Yegappan Lakshmanan) Add tests for no + matches. (closes #947) +Files: src/evalfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2113 +Problem: Test for undo is flaky. +Solution: Turn it into a new style test. Use test_settime() to avoid + flakyness. +Files: src/Makefile, src/undo.c, src/testdir/test61.in, + src/testdir/test61.ok, src/testdir/test_undo.vim, + src/testdir/test_undolevels.vim, src/testdir/Make_all.mak, + src/testdir/test_alot.vim + +Patch 7.4.2114 +Problem: Tiny build fails. +Solution: Always include vim_time(). +Files: src/ex_cmds.c + +Patch 7.4.2115 +Problem: Loading defaults.vim with -C argument. +Solution: Don't load the defaults script with -C argument. Test sourcing + the defaults script. Set 'display' to "truncate". +Files: src/main.c, src/Makefile, runtime/defaults.vim, + src/testdir/test_startup.vim, src/testdir/Make_all.mak + +Patch 7.4.2116 +Problem: The default vimrc for Windows is very conservative. +Solution: Use the defaults.vim in the Windows installer. +Files: src/dosinst.c + +Patch 7.4.2117 +Problem: Deleting an augroup that still has autocmds does not give a + warning. The next defined augroup takes its place. +Solution: Give a warning and prevent the index being used for another group + name. +Files: src/fileio.c, src/testdir/test_autocmd.vim + +Patch 7.4.2118 +Problem: Mac: can't build with tiny features. +Solution: Don't define FEAT_CLIPBOARD unconditionally. (Kazunobu Kuriyama) +Files: src/vim.h + +Patch 7.4.2119 +Problem: Closures are not supported. +Solution: Capture variables in lambdas from the outer scope. (Yasuhiro + Matsumoto, Ken Takata) +Files: runtime/doc/eval.txt, src/eval.c, src/ex_cmds2.c, src/globals.h, + src/proto/eval.pro, src/proto/userfunc.pro, + src/testdir/test_lambda.vim, src/userfunc.c + +Patch 7.4.2120 +Problem: User defined functions can't be a closure. +Solution: Add the "closure" argument. Allow using :unlet on a bound + variable. (Yasuhiro Matsumoto, Ken Takata) +Files: runtime/doc/eval.txt, src/testdir/test_lambda.vim, src/userfunc.c, + src/eval.c src/proto/userfunc.pro + +Patch 7.4.2121 +Problem: No easy way to check if lambda and closure are supported. +Solution: Add the +lambda feature. +Files: src/evalfunc.c, src/version.c, src/testdir/test_lambda.vim + +Patch 7.4.2122 (after 7.4.2118) +Problem: Mac: don't get +clipboard in huge build. +Solution: Move #define down below including featureh.h +Files: src/vim.h + +Patch 7.4.2123 +Problem: No new style test for diff mode. +Solution: Add a test. Check that folds are in sync. +Files: src/Makefile, src/testdir/test_diffmode.vim, + src/testdir/Make_all.mak, src/testdir/test47.in, + src/testdir/test47.ok + +Patch 7.4.2124 +Problem: diffmode test leaves files behind, breaking another test. +Solution: Delete the files. +Files: src/testdir/test_diffmode.vim + +Patch 7.4.2125 +Problem: Compiler warning for loss of data. +Solution: Add a type cast. (Christian Brabandt) +Files: src/message.c + +Patch 7.4.2126 +Problem: No tests for :diffget and :diffput +Solution: Add tests. +Files: src/testdir/test_diffmode.vim + +Patch 7.4.2127 +Problem: The short form of ":noswapfile" is ":noswap" instead of ":nos". + (Kent Sibilev) +Solution: Only require three characters. Add a test for the short forms. +Files: src/ex_docmd.c, src/testdir/test_usercommands.vim + +Patch 7.4.2128 +Problem: Memory leak when saving for undo fails. +Solution: Free allocated memory. (Hirohito Higashi) +Files: src/ex_cmds.c + +Patch 7.4.2129 +Problem: Memory leak when using timer_start(). (Dominique Pelle) +Solution: Don't copy the callback when using a partial. +Files: src/evalfunc.c + +Patch 7.4.2130 +Problem: Pending timers cause false memory leak reports. +Solution: Free all timers on exit. +Files: src/ex_cmds2.c, src/proto/ex_cmds2.pro, src/misc2.c + +Patch 7.4.2131 +Problem: More memory leaks when using partial, e.g. for "exit-cb". +Solution: Don't copy the callback when using a partial. +Files: src/channel.c + +Patch 7.4.2132 +Problem: test_partial has memory leaks reported. +Solution: Add a note about why this happens. +Files: src/testdir/test_partial.vim + +Patch 7.4.2133 (after 7.4.2128) +Problem: Can't build with tiny features. +Solution: Add #ifdef. +Files: src/ex_cmds.c + +Patch 7.4.2134 +Problem: No error for using function() badly. +Solution: Check for passing wrong function name. (Ken Takata) +Files: src/eval.c, src/evalfunc.c, src/proto/userfunc.pro, + src/testdir/test_expr.vim, src/userfunc.c, src/vim.h + +Patch 7.4.2135 +Problem: Various tiny issues. +Solution: Update comments, white space, etc. +Files: src/diff.c, src/digraph.c, src/testdir/test80.in, + src/testdir/test_channel.vim, src/testdir/Makefile, + runtime/menu.vim, src/INSTALLpc.txt, src/xpm/README.txt + +Patch 7.4.2136 +Problem: Closure function fails. +Solution: Don't reset uf_scoped when it points to another funccal. +Files: src/userfunc.c, src/testdir/test_lambda.vim + +Patch 7.4.2137 +Problem: Using function() with a name will find another function when it is + redefined. +Solution: Add funcref(). Refer to lambda using a partial. Fix several + reference counting issues. +Files: src/vim.h, src/structs.h, src/userfunc.c, src/eval.c, + src/evalfunc.c, src/channel.c, src/proto/eval.pro, + src/proto/userfunc.pro, src/if_mzsch.c, src/regexp.c, src/misc2.c, + src/if_py_both.h, src/testdir/test_expr.vim, runtime/doc/eval.txt + +Patch 7.4.2138 +Problem: Test 86 and 87 fail. +Solution: Call func_ref() also for regular functions. +Files: src/if_py_both.h + +Patch 7.4.2139 +Problem: :delfunction causes illegal memory access. +Solution: Correct logic when deciding to free a function. +Files: src/userfunc.c, src/testdir/test_lambda.vim + +Patch 7.4.2140 +Problem: Tiny build fails. +Solution: Add dummy typedefs. +Files: src/structs.h + +Patch 7.4.2141 +Problem: Coverity reports bogus NULL check. +Solution: When checking for a variable in the funccal scope don't pass the + varname. +Files: src/userfunc.c, src/proto/userfunc.pro, src/eval.c + +Patch 7.4.2142 +Problem: Leaking memory when redefining a function. +Solution: Don't increment the function reference count when it's found by + name. Don't remove the wrong function from the hashtab. More + reference counting fixes. +Files: src/structs.h, src/userfunc.c + +Patch 7.4.2143 +Problem: A funccal is garbage collected while it can still be used. +Solution: Set copyID in all referenced functions. Do not list lambda + functions with ":function". +Files: src/userfunc.c, src/proto/userfunc.pro, src/eval.c, + src/testdir/test_lambda.vim + +Patch 7.4.2144 +Problem: On MS-Windows quickix does not handle a line with 1023 bytes + ending in CR-LF properly. +Solution: Don't consider CR a line break. (Ken Takata) +Files: src/quickfix.c + +Patch 7.4.2145 +Problem: Win32: Using CreateThread/ExitThread is not safe. +Solution: Use _beginthreadex and return from the thread. (Ken Takata) +Files: src/os_win32.c + +Patch 7.4.2146 +Problem: Not enough testing for popup menu. CTRL-E does not always work + properly. +Solution: Add more tests. When using CTRL-E check if the popup menu is + visible. (Christian Brabandt) +Files: src/edit.c, src/testdir/test_popup.vim + +Patch 7.4.2147 (after 7.4.2146) +Problem: test_alot fails. +Solution: Close window. +Files: src/testdir/test_popup.vim + +Patch 7.4.2148 +Problem: Not much testing for cscope. +Solution: Add a test that uses the cscope program. (Christian Brabandt) +Files: src/testdir/test_cscope.vim + +Patch 7.4.2149 +Problem: If a test leaves a window open a following test may fail. +Solution: Always close extra windows after running a test. +Files: src/testdir/runtest.vim, src/testdir/test_popup.vim + +Patch 7.4.2150 +Problem: Warning with MinGW 64. (John Marriott) +Solution: Change return type. (Ken Takata) +Files: src/os_win32.c + +Patch 7.4.2151 +Problem: Quickfix test fails on MS-Windows. +Solution: Close the help window. (Christian Brabandt) +Files: src/testdir/test_quickfix.vim + +Patch 7.4.2152 +Problem: No proper translation of messages with a count. +Solution: Use ngettext(). (Sergey Alyoshin) +Files: src/evalfunc.c, src/fold.c, src/os_win32.c, src/screen.c, src/vim.h + +Patch 7.4.2153 +Problem: GUI test isn't testing much. +Solution: Turn into a new style test. Execute a shell command. +Files: src/testdir/test_gui.vim, src/testdir/test16.in, + src/testdir/test16.ok, src/testdir/Make_all.mak, src/Makefile, + src/testdir/Make_vms.mms + +Patch 7.4.2154 +Problem: Test_communicate() fails sometimes. +Solution: Add it to the flaky tests. +Files: src/testdir/runtest.vim + +Patch 7.4.2155 +Problem: Quotes make GUI test fail on MS-Windows. +Solution: Remove quotes, strip white space. +Files: src/testdir/test_gui.vim + +Patch 7.4.2156 +Problem: Compiler warning. +Solution: Add type cast. (Ken Takata, Mike Williams) +Files: src/os_win32.c + +Patch 7.4.2157 +Problem: Test_job_start_fails() is expected to report memory leaks, making + it hard to see other leaks in test_partial. +Solution: Move Test_job_start_fails() to a separate test file. +Files: src/testdir/test_partial.vim, src/testdir/test_job_fails.vim, + src/Makefile, src/testdir/Make_all.mak + +Patch 7.4.2158 +Problem: Result of getcompletion('', 'cscope') depends on previous + completion. (Christian Brabandt) +Solution: Call set_context_in_cscope_cmd(). +Files: src/evalfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2159 +Problem: Insufficient testing for cscope. +Solution: Add more tests. (Dominique Pelle) +Files: src/testdir/test_cscope.vim + +Patch 7.4.2160 +Problem: setmatches() mixes up values. (Nikolai Pavlov) +Solution: Save the string instead of reusing a shared buffer. +Files: src/dict.c, src/evalfunc.c, src/testdir/test_expr.vim, + +Patch 7.4.2161 (after 7.4.2160) +Problem: Expression test fails without conceal feature. +Solution: Only check "conceal" with the conceal feature. +Files: src/testdir/test_expr.vim + +Patch 7.4.2162 +Problem: Result of getcompletion('', 'sign') depends on previous + completion. +Solution: Call set_context_in_sign_cmd(). (Dominique Pelle) +Files: src/evalfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2163 +Problem: match() and related functions tested with old style test. +Solution: Convert to new style test. (Hirohito Higashi) +Files: src/Makefile, src/testdir/Make_all.mak, src/testdir/test63.in, + src/testdir/test63.ok, src/testdir/test_alot.vim, + src/testdir/test_match.vim, src/testdir/test_matchstrpos.vim + +Patch 7.4.2164 +Problem: It is not possible to use plugins in an "after" directory to tune + the behavior of a package. +Solution: First load plugins from non-after directories, then packages and + finally plugins in after directories. + Reset 'loadplugins' before executing --cmd arguments. +Files: src/main.c, src/vim.h, src/ex_cmds2.c, src/testdir/Makefile, + src/testdir/shared.vim, src/testdir/test_startup.vim, + src/testdir/setup.vim, runtime/doc/starting.txt + +Patch 7.4.2165 (after 7.4.2164) +Problem: Startup test fails on MS-Windows. +Solution: Don't check output if RunVim() returns zero. +Files: src/testdir/test_startup.vim + +Patch 7.4.2166 (after 7.4.2164) +Problem: Small build can't run startup test. +Solution: Skip the test. +Files: src/testdir/test_startup.vim + +Patch 7.4.2167 (after 7.4.2164) +Problem: Small build can't run tests. +Solution: Don't try setting 'packpath'. +Files: src/testdir/setup.vim + +Patch 7.4.2168 +Problem: Not running the startup test on MS-Windows. +Solution: Write vimcmd. +Files: src/testdir/Make_ming.mak, src/testdir/Make_dos.mak + +Patch 7.4.2169 (after 7.4.2168) +Problem: Startup test gets stuck on MS-Windows. +Solution: Use double quotes. +Files: src/testdir/shared.vim, src/testdir/test_startup.vim + +Patch 7.4.2170 +Problem: Cannot get information about timers. +Solution: Add timer_info(). +Files: src/evalfunc.c, src/ex_cmds2.c, src/proto/ex_cmds2.pro, + runtime/doc/eval.txt + +Patch 7.4.2171 (after 7.4.2170) +Problem: MS-Windows build fails. +Solution: Add QueryPerformanceCounter(). +Files: src/ex_cmds2.c + +Patch 7.4.2172 +Problem: No test for "vim --help". +Solution: Add a test. +Files: src/testdir/test_startup.vim, src/testdir/shared.vim + +Patch 7.4.2173 (after 7.4.2172) +Problem: Can't test help on MS-Windows. +Solution: Skip the test. +Files: src/testdir/test_startup.vim + +Patch 7.4.2174 +Problem: Adding duplicate flags to 'whichwrap' leaves commas behind. +Solution: Also remove the commas. (Naruhiko Nishino) +Files: src/Makefile, src/option.c, src/testdir/Make_all.mak, + src/testdir/test_alot.vim, src/testdir/test_options.in, + src/testdir/test_options.ok, src/testdir/test_options.vim + +Patch 7.4.2175 +Problem: Insufficient testing of cscope. +Solution: Add more tests. (Dominique Pelle) +Files: src/testdir/test_cscope.vim + +Patch 7.4.2176 +Problem: #ifdefs in main() are complicated. +Solution: Always define vim_main2(). Move params to the file level. + (suggested by Ken Takata) +Files: src/main.c, src/structs.h, src/vim.h, src/if_mzsch.c, + src/proto/if_mzsch.pro + +Patch 7.4.2177 +Problem: No testing for -C and -N command line flags, file arguments, + startuptime. +Solution: Add tests. +Files: src/testdir/test_startup.vim, src/testdir/shared.vim + +Patch 7.4.2178 +Problem: No test for reading from stdin. +Solution: Add a test. +Files: src/testdir/test_startup.vim, src/testdir/shared.vim + +Patch 7.4.2179 (after 7.4.2178) +Problem: Reading from stdin test fails on MS-Windows. +Solution: Strip the extra space. +Files: src/testdir/test_startup.vim + +Patch 7.4.2180 +Problem: There is no easy way to stop all timers. There is no way to + temporary pause a timer. +Solution: Add timer_stopall() and timer_pause(). +Files: src/evalfunc.c, src/ex_cmds2.c, src/proto/ex_cmds2.pro, + src/structs.h, src/testdir/test_timers.vim, + src/testdir/shared.vim, runtime/doc/eval.txt + +Patch 7.4.2181 +Problem: Compiler warning for unused variable. +Solution: Remove it. (Dominique Pelle) +Files: src/ex_cmds2.c + +Patch 7.4.2182 +Problem: Color Grey40 used in startup but not in the short list. +Solution: Add Grey40 to the builtin colors. +Files: src/term.c + +Patch 7.4.2183 +Problem: Sign tests are old style. +Solution: Turn them into new style tests. (Dominique Pelle) +Files: src/Makefile, src/testdir/Make_all.mak, src/testdir/test_signs.in, + src/testdir/test_signs.ok, src/testdir/test_signs.vim, + +Patch 7.4.2184 +Problem: Tests that use RunVim() do not actually perform the test. +Solution: Use "return" instead of "call". (Ken Takata) +Files: src/testdir/shared.vim + +Patch 7.4.2185 +Problem: Test glob2regpat does not test much. +Solution: Add a few more test cases. (Dominique Pelle) +Files: src/testdir/test_glob2regpat.vim + +Patch 7.4.2186 +Problem: Timers test is flaky. +Solution: Relax the sleep time check. +Files: src/testdir/test_timers.vim + +Patch 7.4.2187 (after 7.4.2185) +Problem: glob2regpat test fails on Windows. +Solution: Remove the checks that use backslashes. +Files: src/testdir/test_glob2regpat.vim + +Patch 7.4.2188 (after 7.4.2146) +Problem: Completion does not work properly with some plugins. +Solution: Revert the part related to typing CTRL-E. (closes #972) +Files: src/edit.c, src/testdir/test_popup.vim + +Patch 7.4.2189 +Problem: Cannot detect encoding in a fifo. +Solution: Extend the stdin way of detecting encoding to fifo. Add a test + for detecting encoding on stdin and fifo. (Ken Takata) +Files: src/buffer.c, src/fileio.c, src/Makefile, + src/testdir/Make_all.mak, src/testdir/test_startup_utf8.vim, + src/vim.h + +Patch 7.4.2190 +Problem: When startup test fails it's not easy to find out why. + GUI test fails with Gnome. +Solution: Add the help entry matches to a list an assert that. + Set $HOME for Gnome to create .gnome2 directory. +Files: src/testdir/test_startup.vim, src/testdir/test_gui.vim + +Patch 7.4.2191 +Problem: No automatic prototype for vim_main2(). +Solution: Move the #endif. (Ken Takata) +Files: src/main.c, src/vim.h, src/proto/main.pro + +Patch 7.4.2192 +Problem: Generating prototypes with Cygwin doesn't work well. +Solution: Change #ifdefs. (Ken Takata) +Files: src/gui.h, src/gui_w32.c, src/ops.c, src/proto/fileio.pro, + src/proto/message.pro, src/proto/normal.pro, src/proto/ops.pro, + src/vim.h + +Patch 7.4.2193 +Problem: With Gnome when the GUI can't start test_startup hangs. +Solution: Call gui_mch_early_init_check(). (Hirohito Higashi) +Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro + +Patch 7.4.2194 +Problem: Sign tests don't cover enough. +Solution: Add more test cases. (Dominique Pelle) +Files: src/testdir/test_signs.vim + +Patch 7.4.2195 +Problem: MS-Windows: The vimrun program does not support Unicode. +Solution: Use GetCommandLineW(). Cleanup old #ifdefs. (Ken Takata) +Files: src/vimrun.c + +Patch 7.4.2196 +Problem: glob2regpat test doesn't test everything on MS-Windows. +Solution: Add patterns with backslash handling. +Files: src/testdir/test_glob2regpat.vim + +Patch 7.4.2197 +Problem: All functions are freed on exit, which may hide leaks. +Solution: Only free named functions, not reference counted ones. +Files: src/userfunc.c + +Patch 7.4.2198 +Problem: Test alot sometimes fails under valgrind. (Dominique Pelle) +Solution: Avoid passing a callback with the wrong number of arguments. +Files: src/testdir/test_partial.vim + +Patch 7.4.2199 +Problem: In the GUI the cursor is hidden when redrawing any window, + causing flicker. +Solution: Only undraw the cursor when updating the window it's in. +Files: src/screen.c, src/gui.c, src/proto/gui.pro, src/gui_gtk_x11.c + +Patch 7.4.2200 +Problem: Cannot get all information about a quickfix list. +Solution: Add an optional argument to get/set loc/qf list(). (Yegappan + Lakshmanan) +Files: runtime/doc/eval.txt, src/evalfunc.c, src/proto/quickfix.pro, + src/quickfix.c, src/tag.c, src/testdir/test_quickfix.vim + +Patch 7.4.2201 +Problem: The sign column disappears when the last sign is deleted. +Solution: Add the 'signcolumn' option. (Christian Brabandt) +Files: runtime/doc/options.txt, runtime/optwin.vim, src/edit.c, + src/move.c, src/option.c, src/option.h, src/proto/option.pro, + src/screen.c, src/structs.h, src/testdir/test_options.vim + +Patch 7.4.2202 +Problem: Build fails with small features. +Solution: Correct option initialization. +Files: src/option.c + +Patch 7.4.2203 +Problem: Test fails with normal features. +Solution: Check is signs are supported. +Files: src/testdir/test_options.vim + +Patch 7.4.2204 +Problem: It is not easy to get information about buffers, windows and + tabpages. +Solution: Add getbufinfo(), getwininfo() and gettabinfo(). (Yegappan + Lakshmanan) +Files: runtime/doc/eval.txt, runtime/doc/usr_41.txt, src/dict.c, + src/evalfunc.c, src/option.c, src/proto/dict.pro, + src/proto/option.pro, src/proto/window.pro, + src/testdir/Make_all.mak, src/testdir/test_bufwintabinfo.vim, + src/window.c, src/Makefile + +Patch 7.4.2205 +Problem: 'wildignore' always applies to getcompletion(). +Solution: Add an option to use 'wildignore' or not. (Yegappan Lakshmanan) +Files: runtime/doc/eval.txt, src/evalfunc.c, src/testdir/test_cmdline.vim + +Patch 7.4.2206 +Problem: Warning for unused function. +Solution: Put the function inside #ifdef. (John Marriott) +Files: src/evalfunc.c + +Patch 7.4.2207 +Problem: The +xpm feature is not sorted properly in :version output. +Solution: Move it up. (Tony Mechelynck) +Files: src/version.c + +Patch 7.4.2208 +Problem: Test for mappings is old style. +Solution: Convert the test to new style. +Files: src/testdir/test_mapping.vim, src/testdir/test_mapping.in, + src/testdir/test_mapping.ok, src/Makefile, + src/testdir/test_alot.vim, src/testdir/Make_all.mak + +Patch 7.4.2209 +Problem: Cannot map . (Stephen Riehm) +Solution: Solve the memory access problem in another way. (Dominique Pelle) + Allow for using in a string. +Files: src/eval.c, src/gui_mac.c, src/misc2.c, src/option.c, + src/proto/misc2.pro, src/syntax.c, src/term.c, + src/testdir/test_mapping.vim + +Patch 7.4.2210 +Problem: On OSX configure mixes up a Python framework and the Unix layout. +Solution: Make configure check properly. (Tim D. Smith, closes #980) +Files: src/configure.in, src/auto/configure + +Patch 7.4.2211 +Problem: Mouse support is not automatically enabled with simple term. +Solution: Recognize "st" and other names. (Manuel Schiller, closes #963) +Files: src/os_unix.c + +Patch 7.4.2212 +Problem: Mark " is not set when closing a window in another tab. (Guraga) +Solution: Check all tabs for the window to be valid. (based on patch by + Hirohito Higashi, closes #974) +Files: src/window.c, src/proto/window.pro, src/buffer.c, + src/testdir/test_viminfo.vim + +Patch 7.4.2213 +Problem: Cannot highlight the "~" lines at the end of a window differently. +Solution: Add the EndOfBuffer highlighting. (Marco Hinz, James McCoy) +Files: runtime/doc/options.txt, runtime/doc/syntax.txt, src/option.c, + src/screen.c, src/syntax.c, src/vim.h + +Patch 7.4.2214 +Problem: A font that uses ligatures messes up the screen display. +Solution: Put spaces between characters when building the glyph table. + (based on a patch from Manuel Schiller) +Files: src/gui_gtk_x11.c + +Patch 7.4.2215 +Problem: It's not easy to find out if a window is a quickfix or location + list window. +Solution: Add "loclist" and "quickfix" entries to the dict returnec by + getwininfo(). (Yegappan Lakshmanan) +Files: runtime/doc/eval.txt, src/evalfunc.c, + src/testdir/test_bufwintabinfo.vim + +Patch 7.4.2216 (after 7.4.2215) +Problem: Test fails without the +sign feature. +Solution: Only check for signcolumn with the +sign feature. +Files: src/testdir/test_bufwintabinfo.vim + +Patch 7.4.2217 +Problem: When using matchaddpos() a character after the end of the line can + be highlighted. +Solution: Only highlight existing characters. (Hirohito Higashi) +Files: src/screen.c, src/structs.h, src/testdir/test_match.vim + +[STILL MORE COMING!] vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 4619b5056f..eeaadbc39b 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 7.4. Last change: 2016 Feb 12 +*vi_diff.txt* For Vim version 7.4. Last change: 2016 Aug 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -147,7 +147,7 @@ Support for different systems. resource usage, esp. on MS-DOS. For some outdated systems you need to use an older Vim version. -Multi level undo. |undo| +Multi level persistent undo. |undo| 'u' goes backward in time, 'CTRL-R' goes forward again. Set option 'undolevels' to the number of changes to be remembered (default 1000). Set 'undolevels' to 0 for a Vi-compatible one level undo. Set it to @@ -158,6 +158,9 @@ Multi level undo. |undo| create a branch in the undo tree. This means you can go back to any state of the text, there is no risk of a change causing text to be lost forever. |undo-tree| + The undo information is stored in a file when the 'undofile' option is + set. This means you can exit Vim, start Vim on a previously edited + file and undo changes that were made before exiting Vim. Graphical User Interface (GUI). |gui| Included support for GUI: menu's, mouse, scrollbars, etc. You can @@ -212,6 +215,15 @@ Plugins. |add-plugin| right directory. That's an easy way to start using Vim scripts written by others. Plugins can be for all kind of files, or specifically for a filetype. + Packages make this even easier. |packages| + +Asynchronous communication and timers. |channel| |job| |timer| + Vim can exchange messages with other processes in the background. + This makes it possible to have servers do work and send back the + results to Vim. |channel| + Vim can start a job, communicate with it and stop it. |job| + Timers can fire once or repeatedly and invoke a function to do any + work. |timer| Repeat a series of commands. |q| "q{c}" starts recording typed characters into named register {c}. diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim index 21c8fff86c..3507e305ed 100644 --- a/runtime/indent/javascript.vim +++ b/runtime/indent/javascript.vim @@ -1,18 +1,192 @@ " Vim indent file -" Language: Javascript -" Maintainer: Going to be Darrick Wiebe -" Last Change: 2015 Jun 09 +" Language: Javascript +" Maintainer: vim-javascript community +" URL: https://github.com/pangloss/vim-javascript +" Last Change: August 12, 2016 " Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish +if exists('b:did_indent') + finish endif let b:did_indent = 1 -" C indenting is not too bad. -setlocal cindent +" Now, set up our indentation expression and keys that trigger it. +setlocal indentexpr=GetJavascriptIndent() +setlocal nolisp +setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e setlocal cinoptions+=j1,J1 -setlocal cinkeys-=0# -setlocal cinkeys+=0] -let b:undo_indent = "setl cin<" +let b:undo_indent = 'setlocal indentexpr< indentkeys< cinoptions<' + +" Only define the function once. +if exists('*GetJavascriptIndent') + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" Get shiftwidth value +if exists('*shiftwidth') + function s:sw() + return shiftwidth() + endfunction +else + function s:sw() + return &sw + endfunction +endif + +let s:line_pre = '^\s*\%(\/\*.\{-}\*\/\s*\)*' +let s:expr_case = s:line_pre . '\%(\%(case\>.\+\)\|default\)\s*:' +" Regex of syntax group names that are or delimit string or are comments. +let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)' + +" Regex of syntax group names that are strings or documentation. +let s:syng_comment = '\%(comment\|doc\)' + +" Expression used to check whether we should skip a match with searchpair(). +let s:skip_expr = "line('.') < (prevnonblank(v:lnum) - 2000) ? dummy : synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'" + +function s:lookForParens(start,end,flags,time) + if has('reltime') + return searchpair(a:start,'',a:end,a:flags,s:skip_expr,0,a:time) + else + return searchpair(a:start,'',a:end,a:flags,0,0) + endif +endfunction + +let s:line_term = '\%(\s*\%(\/\*.\{-}\*\/\s*\)\=\)\@>$' + +" configurable regexes that define continuation lines, not including (, {, or [. +if !exists('g:javascript_opfirst') + let g:javascript_opfirst = '\%([<>,:?^%]\|\([-/.+]\)\%(\1\|\*\|\/\)\@!\|\*\/\@!\|=>\@!\||\|&\|in\%(stanceof\)\=\>\)' +endif +let g:javascript_opfirst = s:line_pre . g:javascript_opfirst + +if !exists('g:javascript_continuation') + let g:javascript_continuation = '\%([<*,.?:^%]\|+\@\|\*\@' . (a:add ? '\|\ -1) && + \ s:lookForParens('(', ')', 'cbW', 100) > 0 && search((a:add ? + \ '\%(function\*\|[[:lower:][:upper:]_$][[:digit:][:lower:][:upper:]_$]*\)' : + \ '\<\%(for\%(\s\+each\)\=\|if\|let\|w\%(hile\|ith\)\)') . '\_s*\%#\C','bW') && + \ (a:add || (expand('') ==# 'while' ? !s:lookForParens('\\C', '\\C','bW',100) : 1)) +endfunction + +" Auxiliary Functions {{{2 + +" strip line of comment +function s:StripLine(c) + return a:c !~# s:expr_case ? substitute(a:c, '\%(:\@ 0 + if synIDattr(synID(l:lnum,matchend(getline(l:lnum), '^\s*[^''"]'),0),'name') !~? s:syng_strcom + break + endif + let l:lnum = prevnonblank(l:lnum - 1) + endwhile + return l:lnum +endfunction + +" Check if line 'lnum' has a balanced amount of parentheses. +function s:Balanced(lnum) + let open_0 = 0 + let open_2 = 0 + let open_4 = 0 + let l:line = getline(a:lnum) + let pos = match(l:line, '[][(){}]', 0) + while pos != -1 + if synIDattr(synID(a:lnum,pos + 1,0),'name') !~? s:syng_strcom + let idx = stridx('(){}[]', l:line[pos]) + if idx % 2 == 0 + let open_{idx} = open_{idx} + 1 + else + let open_{idx - 1} = open_{idx - 1} - 1 + endif + endif + let pos = match(l:line, '[][(){}]', pos + 1) + endwhile + return (!open_4 + !open_2 + !open_0) - 2 +endfunction +" }}} + +function GetJavascriptIndent() + if !exists('b:js_cache') + let b:js_cache = [0,0,0] + endif + " Get the current line. + let l:line = getline(v:lnum) + let syns = synIDattr(synID(v:lnum, 1, 0), 'name') + + " start with strings,comments,etc.{{{2 + if (l:line !~ '^[''"`]' && syns =~? 'string\|template') || + \ (l:line !~ '^\s*[/*]' && syns =~? s:syng_comment) + return -1 + endif + if l:line !~ '^\%(\/\*\|\s*\/\/\)' && syns =~? s:syng_comment + return cindent(v:lnum) + endif + let l:lnum = s:PrevCodeLine(v:lnum - 1) + if l:lnum == 0 + return 0 + endif + + if (l:line =~# s:expr_case) + let cpo_switch = &cpo + set cpo+=% + let ind = cindent(v:lnum) + let &cpo = cpo_switch + return ind + endif + "}}} + + " the containing paren, bracket, curly. Memoize, last lineNr either has the + " same scope or starts a new one, unless if it closed a scope. + call cursor(v:lnum,1) + if b:js_cache[0] >= l:lnum && b:js_cache[0] <= v:lnum && b:js_cache[0] && + \ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum) > 0) + let num = b:js_cache[1] + elseif syns != '' && l:line[0] =~ '\s' + let pattern = syns =~? 'block' ? ['{','}'] : syns =~? 'jsparen' ? ['(',')'] : + \ syns =~? 'jsbracket'? ['\[','\]'] : ['[({[]','[])}]'] + let num = s:lookForParens(pattern[0],pattern[1],'bW',2000) + else + let num = s:lookForParens('[({[]','[])}]','bW',2000) + endif + let b:js_cache = [v:lnum,num,line('.') == v:lnum ? b:js_cache[2] : col('.')] + + if l:line =~ s:line_pre . '[])}]' + return indent(num) + endif + + let pline = s:StripLine(getline(l:lnum)) + let inb = num == 0 ? 1 : (s:Onescope(num, s:StripLine(strpart(getline(num),0,b:js_cache[2] - 1)),1) || + \ (l:line !~ s:line_pre . ',' && pline !~ ',' . s:line_term)) && num < l:lnum + let switch_offset = (!inb || num == 0) || expand("") !=# 'switch' ? 0 : &cino !~ ':' || !has('float') ? s:sw() : + \ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '.*:[^,]*s' ? s:sw() : 1)) + + " most significant, find the indent amount + if (inb && (l:line =~# g:javascript_opfirst || + \ (pline =~# g:javascript_continuation && pline !~# s:expr_case && (pline !~ ':' . s:line_term || l:line !~# + \ s:line_pre . '\%(d\%(o\|ebugger\)\|else\|f\%(or\|inally\)\|if\|let\|switch\|t\%(hrow\|ry\)\|w\%(hile\|ith\)\)\>')))) || + \ (num < l:lnum && s:Onescope(l:lnum,pline,0) && l:line !~ s:line_pre . '{') + return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset + elseif num > 0 + return indent(num) + s:sw() + switch_offset + endif + +endfunction + + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim index aa4906ce0a..3201462fbc 100644 --- a/runtime/indent/yaml.vim +++ b/runtime/indent/yaml.vim @@ -37,7 +37,7 @@ function s:FindPrevLessIndentedLine(lnum, ...) let curindent = a:0 ? a:1 : indent(a:lnum) while prevlnum \&& indent(prevlnum) >= curindent - \&& getline(prevlnum) !~# '^\s*#' + \&& getline(prevlnum) =~# '^\s*#' let prevlnum = prevnonblank(prevlnum-1) endwhile return prevlnum @@ -51,11 +51,33 @@ function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex) return plilnum endfunction -let s:mapkeyregex='\v^\s*%(\''%([^'']|'''')*\'''. - \ '|\"%([^"\\]|\\.)*\"'. - \ '|%(%(\:\ )@!.)*)\:%(\ |$)' +let s:mapkeyregex='\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\'''. + \ '|\"%([^"\\]|\\.)*\"'. + \ '|%(%(\:\ )@!.)*)\:%(\ |$)' let s:liststartregex='\v^\s*%(\-%(\ |$))' +let s:c_ns_anchor_char = '\v%([\n\r\uFEFF \t,[\]{}]@!\p)' +let s:c_ns_anchor_name = s:c_ns_anchor_char.'+' +let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name + +let s:ns_word_char = '\v[[:alnum:]_\-]' +let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])' +let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!' +let s:c_secondary_tag_handle = '\v\!\!' +let s:c_primary_tag_handle = '\v\!' +let s:c_tag_handle = '\v%('.s:c_named_tag_handle. + \ '|'.s:c_secondary_tag_handle. + \ '|'.s:c_primary_tag_handle.')' +let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+' +let s:c_non_specific_tag = '\v\!' +let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])' +let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>' +let s:c_ns_tag_property = '\v'.s:c_verbatim_tag. + \ '\v|'.s:c_ns_shorthand_tag. + \ '\v|'.s:c_non_specific_tag + +let s:block_scalar_header = '\v[|>]%([+-]?[1-9]|[1-9]?[+-])?' + function GetYAMLIndent(lnum) if a:lnum == 1 || !prevnonblank(a:lnum-1) return 0 @@ -127,7 +149,10 @@ function GetYAMLIndent(lnum) " - List with " multiline scalar return previndent+2 - elseif prevline =~# s:mapkeyregex + elseif prevline =~# s:mapkeyregex . '\v\s*%(%('.s:c_ns_tag_property. + \ '\v|'.s:c_ns_anchor_property. + \ '\v|'.s:block_scalar_header. + \ '\v)%(\s+|\s*%(\#.*)?$))*' " Mapping with: value " that is multiline scalar return previndent+s:shiftwidth() diff --git a/runtime/optwin.vim b/runtime/optwin.vim index d8d43e9e98..b2942fc2fb 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar -" Last Change: 2016 Apr 30 +" Last Change: 2016 Aug 12 " If there already is an option window, jump to that one. if bufwinnr("option-window") > 0 @@ -1322,6 +1322,11 @@ call append("$", "\t(local to buffer)") call BinOptionL("bl") call append("$", "debug\tset to \"msg\" to see all error messages") call append("$", " \tset debug=" . &debug) +if has("signs") + call append("$", "signcolumn\twhether to show the signcolumn") + call append("$", "\t(local to window)") + call OptionL("scl") +endif if has("mzscheme") call append("$", "mzquantum\tinterval in milliseconds between polls for MzScheme threads") call append("$", " \tset mzq=" . &mzq) diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim index d1693cba41..15b66925e5 100644 --- a/runtime/syntax/dockerfile.vim +++ b/runtime/syntax/dockerfile.vim @@ -1,7 +1,7 @@ " dockerfile.vim - Syntax highlighting for Dockerfiles -" Maintainer: Honza Pokorny -" Version: 0.5 -" Last Change: 2014 Aug 29 +" Maintainer: Honza Pokorny +" Version: 0.6 +" Last Change: 2016 Aug 9 " License: BSD @@ -13,7 +13,7 @@ let b:current_syntax = "dockerfile" syntax case ignore -syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR|COPY)\s/ +syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)\s/ syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/ diff --git a/runtime/syntax/sshconfig.vim b/runtime/syntax/sshconfig.vim index bd9f0a3c28..302d073f1e 100644 --- a/runtime/syntax/sshconfig.vim +++ b/runtime/syntax/sshconfig.vim @@ -4,8 +4,9 @@ " Maintainer: Dominik Fischer " Contributor: Leonard Ehrenfried " Contributor: Karsten Hopp -" Last Change: 2016 Apr 7 -" SSH Version: 7.2p2 +" Contributor: Dean, Adam Kenneth +" Last Change: 2016 Aug 11 +" SSH Version: 7.3p1 " " Setup @@ -205,6 +206,7 @@ syn keyword sshconfigKeyword Port syn keyword sshconfigKeyword PreferredAuthentications syn keyword sshconfigKeyword Protocol syn keyword sshconfigKeyword ProxyCommand +syn keyword sshconfigKeyword ProxyJump syn keyword sshconfigKeyword ProxyUseFDPass syn keyword sshconfigKeyword PubkeyAcceptedKeyTypes syn keyword sshconfigKeyword PubkeyAuthentication diff --git a/src/Makefile b/src/Makefile index f40a598eef..8d91a2bd2f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2045,7 +2045,6 @@ test1 \ test_listchars \ test_listlbr \ test_listlbr_utf8 \ - test_mapping \ test_marks \ test_nested_function \ test_search_mbyte \ @@ -2073,6 +2072,7 @@ test_arglist \ test_autochdir \ test_autocmd \ test_backspace_opt \ + test_bufwintabinfo \ test_cdo \ test_channel \ test_cmdline \ @@ -2110,6 +2110,7 @@ test_arglist \ test_largefile \ test_lispwords \ test_man \ + test_mapping \ test_match \ test_matchadd_conceal \ test_matchadd_conceal_utf8 \ diff --git a/src/auto/configure b/src/auto/configure index e0ecbbd679..4d9e1e83ae 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -6049,7 +6049,7 @@ __: eof eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" rm -f -- "${tmp_mkf}" - if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \ + if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then vi_cv_path_python_plibs="-framework Python" if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then diff --git a/src/buffer.c b/src/buffer.c index ed06120ca7..18f4fc8bc2 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -475,7 +475,7 @@ close_buffer( if (win != NULL #ifdef FEAT_WINDOWS - && win_valid(win) /* in case autocommands closed the window */ + && win_valid_any_tab(win) /* in case autocommands closed the window */ #endif ) { @@ -581,7 +581,7 @@ aucmd_abort: if ( #ifdef FEAT_WINDOWS - win_valid(win) && + win_valid_any_tab(win) && #else win != NULL && #endif diff --git a/src/configure.in b/src/configure.in index c1a2da36ca..b92610aaf7 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1223,7 +1223,7 @@ eof dnl -- delete the lines from make about Entering/Leaving directory eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" rm -f -- "${tmp_mkf}" - if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \ + if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then vi_cv_path_python_plibs="-framework Python" if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then diff --git a/src/dict.c b/src/dict.c index 30a15a6f07..d78d42d521 100644 --- a/src/dict.c +++ b/src/dict.c @@ -366,6 +366,30 @@ dict_add_list(dict_T *d, char *key, list_T *list) return OK; } +/* + * Add a dict entry to dictionary "d". + * Returns FAIL when out of memory and when key already exists. + */ + int +dict_add_dict(dict_T *d, char *key, dict_T *dict) +{ + dictitem_T *item; + + item = dictitem_alloc((char_u *)key); + if (item == NULL) + return FAIL; + item->di_tv.v_lock = 0; + item->di_tv.v_type = VAR_DICT; + item->di_tv.vval.v_dict = dict; + if (dict_add(d, item) == FAIL) + { + dictitem_free(item); + return FAIL; + } + ++dict->dv_refcount; + return OK; +} + /* * Get the number of items in a Dictionary. */ diff --git a/src/edit.c b/src/edit.c index 87870e251d..92379ecc64 100644 --- a/src/edit.c +++ b/src/edit.c @@ -6775,11 +6775,7 @@ comp_textwidth( textwidth -= curwin->w_p_fdc; #endif #ifdef FEAT_SIGNS - if (curwin->w_buffer->b_signlist != NULL -# ifdef FEAT_NETBEANS_INTG - || curwin->w_buffer->b_has_sign_column -# endif - ) + if (signcolumn_on(curwin)) textwidth -= 1; #endif if (curwin->w_p_nu || curwin->w_p_rnu) diff --git a/src/eval.c b/src/eval.c index 45b8f07c38..2ab3ee4b90 100644 --- a/src/eval.c +++ b/src/eval.c @@ -233,8 +233,6 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate); static int get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate); static int free_unref_items(int copyID); static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate); - - static int get_env_len(char_u **arg); static char_u * make_expanded_name(char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end); static void check_vars(char_u *name, int len); @@ -4926,7 +4924,7 @@ get_string_tv(char_u **arg, typval_T *rettv, int evaluate) break; /* Special key, e.g.: "\" */ - case '<': extra = trans_special(&p, name, TRUE); + case '<': extra = trans_special(&p, name, TRUE, TRUE); if (extra != 0) { name += extra; @@ -4943,6 +4941,11 @@ get_string_tv(char_u **arg, typval_T *rettv, int evaluate) } *name = NUL; + if (p == NUL) + { + EMSG2(_("E114: Missing quote: %s"), *arg); + return FAIL; + } *arg = p + 1; return OK; diff --git a/src/evalfunc.c b/src/evalfunc.c index 0e44b164c6..b92fd0e7fc 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -152,6 +152,7 @@ static void f_funcref(typval_T *argvars, typval_T *rettv); static void f_function(typval_T *argvars, typval_T *rettv); static void f_garbagecollect(typval_T *argvars, typval_T *rettv); static void f_get(typval_T *argvars, typval_T *rettv); +static void f_getbufinfo(typval_T *argvars, typval_T *rettv); static void f_getbufline(typval_T *argvars, typval_T *rettv); static void f_getbufvar(typval_T *argvars, typval_T *rettv); static void f_getchar(typval_T *argvars, typval_T *rettv); @@ -171,6 +172,7 @@ static void f_getfsize(typval_T *argvars, typval_T *rettv); static void f_getftime(typval_T *argvars, typval_T *rettv); static void f_getftype(typval_T *argvars, typval_T *rettv); static void f_getline(typval_T *argvars, typval_T *rettv); +static void f_getloclist(typval_T *argvars UNUSED, typval_T *rettv UNUSED); static void f_getmatches(typval_T *argvars, typval_T *rettv); static void f_getpid(typval_T *argvars, typval_T *rettv); static void f_getcurpos(typval_T *argvars, typval_T *rettv); @@ -178,8 +180,10 @@ static void f_getpos(typval_T *argvars, typval_T *rettv); static void f_getqflist(typval_T *argvars, typval_T *rettv); static void f_getreg(typval_T *argvars, typval_T *rettv); static void f_getregtype(typval_T *argvars, typval_T *rettv); +static void f_gettabinfo(typval_T *argvars, typval_T *rettv); static void f_gettabvar(typval_T *argvars, typval_T *rettv); static void f_gettabwinvar(typval_T *argvars, typval_T *rettv); +static void f_getwininfo(typval_T *argvars, typval_T *rettv); static void f_getwinposx(typval_T *argvars, typval_T *rettv); static void f_getwinposy(typval_T *argvars, typval_T *rettv); static void f_getwinvar(typval_T *argvars, typval_T *rettv); @@ -571,6 +575,7 @@ static struct fst {"function", 1, 3, f_function}, {"garbagecollect", 0, 1, f_garbagecollect}, {"get", 2, 3, f_get}, + {"getbufinfo", 0, 1, f_getbufinfo}, {"getbufline", 2, 3, f_getbufline}, {"getbufvar", 2, 3, f_getbufvar}, {"getchar", 0, 1, f_getchar}, @@ -581,7 +586,7 @@ static struct fst {"getcmdtype", 0, 0, f_getcmdtype}, {"getcmdwintype", 0, 0, f_getcmdwintype}, #if defined(FEAT_CMDL_COMPL) - {"getcompletion", 2, 2, f_getcompletion}, + {"getcompletion", 2, 3, f_getcompletion}, #endif {"getcurpos", 0, 0, f_getcurpos}, {"getcwd", 0, 2, f_getcwd}, @@ -591,15 +596,17 @@ static struct fst {"getftime", 1, 1, f_getftime}, {"getftype", 1, 1, f_getftype}, {"getline", 1, 2, f_getline}, - {"getloclist", 1, 1, f_getqflist}, + {"getloclist", 1, 2, f_getloclist}, {"getmatches", 0, 0, f_getmatches}, {"getpid", 0, 0, f_getpid}, {"getpos", 1, 1, f_getpos}, - {"getqflist", 0, 0, f_getqflist}, + {"getqflist", 0, 1, f_getqflist}, {"getreg", 0, 3, f_getreg}, {"getregtype", 0, 1, f_getregtype}, + {"gettabinfo", 0, 1, f_gettabinfo}, {"gettabvar", 2, 3, f_gettabvar}, {"gettabwinvar", 3, 4, f_gettabwinvar}, + {"getwininfo", 0, 1, f_getwininfo}, {"getwinposx", 0, 0, f_getwinposx}, {"getwinposy", 0, 0, f_getwinposy}, {"getwinvar", 2, 3, f_getwinvar}, @@ -741,10 +748,10 @@ static struct fst {"setcmdpos", 1, 1, f_setcmdpos}, {"setfperm", 2, 2, f_setfperm}, {"setline", 2, 2, f_setline}, - {"setloclist", 2, 3, f_setloclist}, + {"setloclist", 2, 4, f_setloclist}, {"setmatches", 1, 1, f_setmatches}, {"setpos", 2, 2, f_setpos}, - {"setqflist", 1, 2, f_setqflist}, + {"setqflist", 1, 3, f_setqflist}, {"setreg", 2, 3, f_setreg}, {"settabvar", 3, 3, f_settabvar}, {"settabwinvar", 4, 4, f_settabwinvar}, @@ -3881,6 +3888,161 @@ f_get(typval_T *argvars, typval_T *rettv) copy_tv(tv, rettv); } +#ifdef FEAT_SIGNS +/* + * Returns information about signs placed in a buffer as list of dicts. + */ + static void +get_buffer_signs(buf_T *buf, list_T *l) +{ + signlist_T *sign; + + for (sign = buf->b_signlist; sign; sign = sign->next) + { + dict_T *d = dict_alloc(); + + if (d != NULL) + { + dict_add_nr_str(d, "id", sign->id, NULL); + dict_add_nr_str(d, "lnum", sign->lnum, NULL); + dict_add_nr_str(d, "name", 0L, + vim_strsave(sign_typenr2name(sign->typenr))); + + list_append_dict(l, d); + } + } +} +#endif + +/* + * Returns buffer options, variables and other attributes in a dictionary. + */ + static dict_T * +get_buffer_info(buf_T *buf) +{ + dict_T *dict; + dict_T *opts; + dict_T *vars; + tabpage_T *tp; + win_T *wp; + list_T *windows; + + dict = dict_alloc(); + if (dict == NULL) + return NULL; + + dict_add_nr_str(dict, "nr", buf->b_fnum, NULL); + dict_add_nr_str(dict, "name", 0L, + buf->b_ffname != NULL ? buf->b_ffname : (char_u *)""); + dict_add_nr_str(dict, "lnum", buflist_findlnum(buf), NULL); + dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL); + dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL); + dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL); + dict_add_nr_str(dict, "changedtick", buf->b_changedtick, NULL); + dict_add_nr_str(dict, "hidden", + buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0, + NULL); + + /* Copy buffer variables */ + vars = dict_copy(buf->b_vars, TRUE, 0); + if (vars != NULL) + dict_add_dict(dict, "variables", vars); + + /* Copy buffer options */ + opts = get_winbuf_options(TRUE); + if (opts != NULL) + dict_add_dict(dict, "options", opts); + + /* List of windows displaying this buffer */ + windows = list_alloc(); + if (windows != NULL) + { + FOR_ALL_TAB_WINDOWS(tp, wp) + if (wp->w_buffer == buf) + list_append_number(windows, (varnumber_T)wp->w_id); + dict_add_list(dict, "windows", windows); + } + +#ifdef FEAT_SIGNS + if (buf->b_signlist != NULL) + { + /* List of signs placed in this buffer */ + list_T *signs = list_alloc(); + if (signs != NULL) + { + get_buffer_signs(buf, signs); + dict_add_list(dict, "signs", signs); + } + } +#endif + + return dict; +} + +/* + * "getbufinfo()" function + */ + static void +f_getbufinfo(typval_T *argvars, typval_T *rettv) +{ + buf_T *buf = NULL; + buf_T *argbuf = NULL; + dict_T *d; + int filtered = FALSE; + int sel_buflisted = FALSE; + int sel_bufloaded = FALSE; + + if (rettv_list_alloc(rettv) != OK) + return; + + /* List of all the buffers or selected buffers */ + if (argvars[0].v_type == VAR_DICT) + { + dict_T *sel_d = argvars[0].vval.v_dict; + + if (sel_d != NULL) + { + dictitem_T *di; + + filtered = TRUE; + + di = dict_find(sel_d, (char_u *)"buflisted", -1); + if (di != NULL && get_tv_number(&di->di_tv)) + sel_buflisted = TRUE; + + di = dict_find(sel_d, (char_u *)"bufloaded", -1); + if (di != NULL && get_tv_number(&di->di_tv)) + sel_bufloaded = TRUE; + } + } + else if (argvars[0].v_type != VAR_UNKNOWN) + { + /* Information about one buffer. Argument specifies the buffer */ + (void)get_tv_number(&argvars[0]); /* issue errmsg if type error */ + ++emsg_off; + argbuf = get_buf_tv(&argvars[0], FALSE); + --emsg_off; + if (argbuf == NULL) + return; + } + + /* Return information about all the buffers or a specified buffer */ + FOR_ALL_BUFFERS(buf) + { + if (argbuf != NULL && argbuf != buf) + continue; + if (filtered && ((sel_bufloaded && buf->b_ml.ml_mfp == NULL) + || (sel_buflisted && !buf->b_p_bl))) + continue; + + d = get_buffer_info(buf); + if (d != NULL) + list_append_dict(rettv->vval.v_list, d); + if (argbuf != NULL) + return; + } +} + static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retlist, typval_T *rettv); /* @@ -4227,12 +4389,20 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) { char_u *pat; expand_T xpc; + int filtered = FALSE; int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH | WILD_NO_BEEP; + if (argvars[2].v_type != VAR_UNKNOWN) + filtered = get_tv_number_chk(&argvars[2], NULL); + if (p_wic) options |= WILD_ICASE; + /* For filtered results, 'wildignore' is used */ + if (!filtered) + options |= WILD_KEEP_ALL; + ExpandInit(&xpc); xpc.xp_pattern = get_tv_string(&argvars[0]); xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); @@ -4536,6 +4706,49 @@ f_getline(typval_T *argvars, typval_T *rettv) get_buffer_lines(curbuf, lnum, end, retlist, rettv); } +#ifdef FEAT_QUICKFIX + static void +get_qf_loc_list(int is_qf, win_T *wp, typval_T *what_arg, typval_T *rettv) +{ + if (what_arg->v_type == VAR_UNKNOWN) + { + if (rettv_list_alloc(rettv) == OK) + if (is_qf || wp != NULL) + (void)get_errorlist(wp, -1, rettv->vval.v_list); + } + else + { + if (rettv_dict_alloc(rettv) == OK) + if (is_qf || (wp != NULL)) + { + if (what_arg->v_type == VAR_DICT) + { + dict_T *d = what_arg->vval.v_dict; + + if (d != NULL) + get_errorlist_properties(wp, d, rettv->vval.v_dict); + } + else + EMSG(_(e_dictreq)); + } + } +} +#endif + +/* + * "getloclist()" function + */ + static void +f_getloclist(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +{ +#ifdef FEAT_QUICKFIX + win_T *wp; + + wp = find_win_by_nr(&argvars[0], NULL); + get_qf_loc_list(FALSE, wp, &argvars[1], rettv); +#endif +} + /* * "getmatches()" function */ @@ -4673,28 +4886,13 @@ f_getpos(typval_T *argvars, typval_T *rettv) } /* - * "getqflist()" and "getloclist()" functions + * "getqflist()" function */ static void f_getqflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { #ifdef FEAT_QUICKFIX - win_T *wp; -#endif - -#ifdef FEAT_QUICKFIX - if (rettv_list_alloc(rettv) == OK) - { - wp = NULL; - if (argvars[0].v_type != VAR_UNKNOWN) /* getloclist() */ - { - wp = find_win_by_nr(&argvars[0], NULL); - if (wp == NULL) - return; - } - - (void)get_errorlist(wp, rettv->vval.v_list); - } + get_qf_loc_list(TRUE, NULL, &argvars[0], rettv); #endif } @@ -4793,6 +4991,80 @@ f_getregtype(typval_T *argvars, typval_T *rettv) rettv->vval.v_string = vim_strsave(buf); } +#ifdef FEAT_WINDOWS +/* + * Returns information (variables, options, etc.) about a tab page + * as a dictionary. + */ + static dict_T * +get_tabpage_info(tabpage_T *tp, int tp_idx) +{ + win_T *wp; + dict_T *dict; + dict_T *vars; + list_T *l; + + dict = dict_alloc(); + if (dict == NULL) + return NULL; + + dict_add_nr_str(dict, "nr", tp_idx, NULL); + + l = list_alloc(); + if (l != NULL) + { + for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin; + wp; wp = wp->w_next) + list_append_number(l, (varnumber_T)wp->w_id); + dict_add_list(dict, "windows", l); + } + + /* Copy tabpage variables */ + vars = dict_copy(tp->tp_vars, TRUE, 0); + if (vars != NULL) + dict_add_dict(dict, "variables", vars); + + return dict; +} +#endif + +/* + * "gettabinfo()" function + */ + static void +f_gettabinfo(typval_T *argvars, typval_T *rettv) +{ +#ifdef FEAT_WINDOWS + tabpage_T *tp, *tparg = NULL; + dict_T *d; + int tpnr = 0; + + if (rettv_list_alloc(rettv) != OK) + return; + + if (argvars[0].v_type != VAR_UNKNOWN) + { + /* Information about one tab page */ + tparg = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); + if (tparg == NULL) + return; + } + + /* Get information about a specific tab page or all tab pages */ + FOR_ALL_TABPAGES(tp) + { + tpnr++; + if (tparg != NULL && tp != tparg) + continue; + d = get_tabpage_info(tp, tpnr); + if (d != NULL) + list_append_dict(rettv->vval.v_list, d); + if (tparg != NULL) + return; + } +#endif +} + /* * "gettabvar()" function */ @@ -4845,6 +5117,95 @@ f_gettabwinvar(typval_T *argvars, typval_T *rettv) getwinvar(argvars, rettv, 1); } +#ifdef FEAT_WINDOWS +/* + * Returns information about a window as a dictionary. + */ + static dict_T * +get_win_info(win_T *wp, short tpnr, short winnr) +{ + dict_T *dict; + dict_T *vars; + dict_T *opts; + + dict = dict_alloc(); + if (dict == NULL) + return NULL; + + dict_add_nr_str(dict, "tpnr", tpnr, NULL); + dict_add_nr_str(dict, "nr", winnr, NULL); + dict_add_nr_str(dict, "winid", wp->w_id, NULL); + dict_add_nr_str(dict, "height", wp->w_height, NULL); + dict_add_nr_str(dict, "width", wp->w_width, NULL); + dict_add_nr_str(dict, "bufnum", wp->w_buffer->b_fnum, NULL); + +#ifdef FEAT_QUICKFIX + dict_add_nr_str(dict, "quickfix", bt_quickfix(wp->w_buffer), NULL); + dict_add_nr_str(dict, "loclist", + (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL), NULL); +#endif + + /* Copy window variables */ + vars = dict_copy(wp->w_vars, TRUE, 0); + if (vars != NULL) + dict_add_dict(dict, "variables", vars); + + /* Copy window options */ + opts = get_winbuf_options(FALSE); + if (opts != NULL) + dict_add_dict(dict, "options", opts); + + return dict; +} +#endif + +/* + * "getwininfo()" function + */ + static void +f_getwininfo(typval_T *argvars, typval_T *rettv) +{ +#ifdef FEAT_WINDOWS + tabpage_T *tp; + win_T *wp = NULL, *wparg = NULL; + dict_T *d; + short tabnr = 0, winnr; +#endif + + if (rettv_list_alloc(rettv) != OK) + return; + +#ifdef FEAT_WINDOWS + if (argvars[0].v_type != VAR_UNKNOWN) + { + wparg = win_id2wp(argvars); + if (wparg == NULL) + return; + } + + /* Collect information about either all the windows across all the tab + * pages or one particular window. + */ + FOR_ALL_TABPAGES(tp) + { + tabnr++; + winnr = 0; + FOR_ALL_WINDOWS_IN_TAB(tp, wp) + { + winnr++; + if (wparg != NULL && wp != wparg) + continue; + d = get_win_info(wp, tabnr, winnr); + if (d != NULL) + list_append_dict(rettv->vval.v_list, d); + if (wparg != NULL) + /* found information about a specific window */ + return; + } + } +#endif +} + /* * "getwinposx()" function */ @@ -9552,7 +9913,7 @@ f_setline(typval_T *argvars, typval_T *rettv) appended_lines_mark(lcount, added); } -static void set_qf_ll_list(win_T *wp, typval_T *list_arg, typval_T *action_arg, typval_T *rettv); +static void set_qf_ll_list(win_T *wp, typval_T *list_arg, typval_T *action_arg, typval_T *what_arg, typval_T *rettv); /* * Used by "setqflist()" and "setloclist()" functions @@ -9562,6 +9923,7 @@ set_qf_ll_list( win_T *wp UNUSED, typval_T *list_arg UNUSED, typval_T *action_arg UNUSED, + typval_T *what_arg UNUSED, typval_T *rettv) { #ifdef FEAT_QUICKFIX @@ -9578,6 +9940,8 @@ set_qf_ll_list( else { list_T *l = list_arg->vval.v_list; + dict_T *d = NULL; + int valid_dict = TRUE; if (action_arg->v_type == VAR_STRING) { @@ -9594,8 +9958,20 @@ set_qf_ll_list( else EMSG(_(e_stringreq)); - if (l != NULL && action && set_errorlist(wp, l, action, - (char_u *)(wp == NULL ? "setqflist()" : "setloclist()")) == OK) + if (action_arg->v_type != VAR_UNKNOWN + && what_arg->v_type != VAR_UNKNOWN) + { + if (what_arg->v_type == VAR_DICT) + d = what_arg->vval.v_dict; + else + { + EMSG(_(e_dictreq)); + valid_dict = FALSE; + } + } + + if (l != NULL && action && valid_dict && set_errorlist(wp, l, action, + (char_u *)(wp == NULL ? "setqflist()" : "setloclist()"), d) == OK) rettv->vval.v_number = 0; } #endif @@ -9613,7 +9989,7 @@ f_setloclist(typval_T *argvars, typval_T *rettv) win = find_win_by_nr(&argvars[0], NULL); if (win != NULL) - set_qf_ll_list(win, &argvars[1], &argvars[2], rettv); + set_qf_ll_list(win, &argvars[1], &argvars[2], &argvars[3], rettv); } /* @@ -9781,7 +10157,7 @@ f_setpos(typval_T *argvars, typval_T *rettv) static void f_setqflist(typval_T *argvars, typval_T *rettv) { - set_qf_ll_list(NULL, &argvars[0], &argvars[1], rettv); + set_qf_ll_list(NULL, &argvars[0], &argvars[1], &argvars[2], rettv); } /* diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 30b0d5c313..aeb2bf952d 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -4747,6 +4747,20 @@ check_secure(void) static char_u *old_sub = NULL; /* previous substitute pattern */ static int global_need_beginline; /* call beginline() after ":g" */ +/* + * Flags that are kept between calls to :substitute. + */ +typedef struct { + int do_all; /* do multiple substitutions per line */ + int do_ask; /* ask for confirmation */ + int do_count; /* count only */ + int do_error; /* if false, ignore errors */ + int do_print; /* print last line with subs. */ + int do_list; /* list last line with subs. */ + int do_number; /* list last line with line nr*/ + int do_ic; /* ignore case flag */ +} subflags_T; + /* do_sub() * * Perform a substitution from line eap->line1 to line eap->line2 using the @@ -4762,14 +4776,11 @@ do_sub(exarg_T *eap) linenr_T lnum; long i = 0; regmmatch_T regmatch; - static int do_all = FALSE; /* do multiple substitutions per line */ - static int do_ask = FALSE; /* ask for confirmation */ - static int do_count = FALSE; /* count only */ - static int do_error = TRUE; /* if false, ignore errors */ - static int do_print = FALSE; /* print last line with subs. */ - static int do_list = FALSE; /* list last line with subs. */ - static int do_number = FALSE; /* list last line with line nr*/ - static int do_ic = 0; /* ignore case flag */ + static subflags_T subflags = {FALSE, FALSE, FALSE, TRUE, FALSE, + FALSE, FALSE, 0}; +#ifdef FEAT_EVAL + subflags_T subflags_save; +#endif int save_do_all; /* remember user specified 'g' flag */ int save_do_ask; /* remember user specified 'c' flag */ char_u *pat = NULL, *sub = NULL; /* init for GCC */ @@ -4957,16 +4968,16 @@ do_sub(exarg_T *eap) if (!p_ed) { if (p_gd) /* default is global on */ - do_all = TRUE; + subflags.do_all = TRUE; else - do_all = FALSE; - do_ask = FALSE; + subflags.do_all = FALSE; + subflags.do_ask = FALSE; } - do_error = TRUE; - do_print = FALSE; - do_count = FALSE; - do_number = FALSE; - do_ic = 0; + subflags.do_error = TRUE; + subflags.do_print = FALSE; + subflags.do_count = FALSE; + subflags.do_number = FALSE; + subflags.do_ic = 0; } while (*cmd) { @@ -4975,40 +4986,40 @@ do_sub(exarg_T *eap) * 'r' is never inverted. */ if (*cmd == 'g') - do_all = !do_all; + subflags.do_all = !subflags.do_all; else if (*cmd == 'c') - do_ask = !do_ask; + subflags.do_ask = !subflags.do_ask; else if (*cmd == 'n') - do_count = TRUE; + subflags.do_count = TRUE; else if (*cmd == 'e') - do_error = !do_error; + subflags.do_error = !subflags.do_error; else if (*cmd == 'r') /* use last used regexp */ which_pat = RE_LAST; else if (*cmd == 'p') - do_print = TRUE; + subflags.do_print = TRUE; else if (*cmd == '#') { - do_print = TRUE; - do_number = TRUE; + subflags.do_print = TRUE; + subflags.do_number = TRUE; } else if (*cmd == 'l') { - do_print = TRUE; - do_list = TRUE; + subflags.do_print = TRUE; + subflags.do_list = TRUE; } else if (*cmd == 'i') /* ignore case */ - do_ic = 'i'; + subflags.do_ic = 'i'; else if (*cmd == 'I') /* don't ignore case */ - do_ic = 'I'; + subflags.do_ic = 'I'; else break; ++cmd; } - if (do_count) - do_ask = FALSE; + if (subflags.do_count) + subflags.do_ask = FALSE; - save_do_all = do_all; - save_do_ask = do_ask; + save_do_all = subflags.do_all; + save_do_ask = subflags.do_ask; /* * check for a trailing count @@ -5017,7 +5028,7 @@ do_sub(exarg_T *eap) if (VIM_ISDIGIT(*cmd)) { i = getdigits(&cmd); - if (i <= 0 && !eap->skip && do_error) + if (i <= 0 && !eap->skip && subflags.do_error) { EMSG(_(e_zerocount)); return; @@ -5045,7 +5056,7 @@ do_sub(exarg_T *eap) if (eap->skip) /* not executing commands, only parsing */ return; - if (!do_count && !curbuf->b_p_ma) + if (!subflags.do_count && !curbuf->b_p_ma) { /* Substitution is not allowed in non-'modifiable' buffer */ EMSG(_(e_modifiable)); @@ -5054,15 +5065,15 @@ do_sub(exarg_T *eap) if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, ®match) == FAIL) { - if (do_error) + if (subflags.do_error) EMSG(_(e_invcmd)); return; } /* the 'i' or 'I' flag overrules 'ignorecase' and 'smartcase' */ - if (do_ic == 'i') + if (subflags.do_ic == 'i') regmatch.rmm_ic = TRUE; - else if (do_ic == 'I') + else if (subflags.do_ic == 'I') regmatch.rmm_ic = FALSE; sub_firstline = NULL; @@ -5231,7 +5242,7 @@ do_sub(exarg_T *eap) * 2. If do_count is set only increase the counter. * If do_ask is set, ask for confirmation. */ - if (do_count) + if (subflags.do_count) { /* For a multi-line match, put matchcol at the NUL at * the end of the line and set nmatch to one, so that @@ -5253,7 +5264,7 @@ do_sub(exarg_T *eap) goto skip; } - if (do_ask) + if (subflags.do_ask) { int typed = 0; @@ -5274,19 +5285,20 @@ do_sub(exarg_T *eap) /* * Loop until 'y', 'n', 'q', CTRL-E or CTRL-Y typed. */ - while (do_ask) + while (subflags.do_ask) { if (exmode_active) { char_u *resp; colnr_T sc, ec; - print_line_no_prefix(lnum, do_number, do_list); + print_line_no_prefix(lnum, + subflags.do_number, subflags.do_list); getvcol(curwin, &curwin->w_cursor, &sc, NULL, NULL); curwin->w_cursor.col = regmatch.endpos[0].col - 1; getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec); - if (do_number || curwin->w_p_nu) + if (subflags.do_number || curwin->w_p_nu) { int numw = number_width(curwin) + 1; sc += numw; @@ -5420,13 +5432,13 @@ do_sub(exarg_T *eap) if (typed == 'l') { /* last: replace and then stop */ - do_all = FALSE; + subflags.do_all = FALSE; line2 = lnum; break; } if (typed == 'a') { - do_ask = FALSE; + subflags.do_ask = FALSE; break; } #ifdef FEAT_INS_EXPAND @@ -5469,23 +5481,29 @@ do_sub(exarg_T *eap) * 3. substitute the string. */ #ifdef FEAT_EVAL - if (do_count) + if (subflags.do_count) { /* prevent accidentally changing the buffer by a function */ save_ma = curbuf->b_p_ma; curbuf->b_p_ma = FALSE; sandbox++; } + /* Save flags for recursion. They can change for e.g. + * :s/^/\=execute("s#^##gn") */ + subflags_save = subflags; #endif /* get length of substitution part */ sublen = vim_regsub_multi(®match, sub_firstlnum - regmatch.startpos[0].lnum, sub, sub_firstline, FALSE, p_magic, TRUE); #ifdef FEAT_EVAL - if (do_count) + /* Don't keep flags set by a recursive call. */ + subflags = subflags_save; + if (subflags.do_count) { curbuf->b_p_ma = save_ma; - sandbox--; + if (sandbox > 0) + sandbox--; goto skip; } #endif @@ -5578,7 +5596,7 @@ do_sub(exarg_T *eap) if (sub_firstlnum <= line2) do_again = TRUE; else - do_all = FALSE; + subflags.do_all = FALSE; } /* Remember next character to be copied. */ @@ -5613,7 +5631,7 @@ do_sub(exarg_T *eap) ml_append(lnum - 1, new_start, (colnr_T)(p1 - new_start + 1), FALSE); mark_adjust(lnum + 1, (linenr_T)MAXLNUM, 1L, 0L); - if (do_ask) + if (subflags.do_ask) appended_lines(lnum - 1, 1L); else { @@ -5654,7 +5672,7 @@ skip: || got_int || got_quit || lnum > line2 - || !(do_all || do_again) + || !(subflags.do_all || do_again) || (sub_firstline[matchcol] == NUL && nmatch <= 1 && !re_multiline(regmatch.regprog))); nmatch = -1; @@ -5708,7 +5726,7 @@ skip: ml_delete(lnum, (int)FALSE); mark_adjust(lnum, lnum + nmatch_tl - 1, (long)MAXLNUM, -nmatch_tl); - if (do_ask) + if (subflags.do_ask) deleted_lines(lnum, nmatch_tl); --lnum; line2 -= nmatch_tl; /* nr of lines decreases */ @@ -5717,7 +5735,7 @@ skip: /* When asking, undo is saved each time, must also set * changed flag each time. */ - if (do_ask) + if (subflags.do_ask) changed_bytes(lnum, 0); else { @@ -5779,7 +5797,7 @@ outofmem: vim_free(sub_firstline); /* may have to free allocated copy of the line */ /* ":s/pat//n" doesn't move the cursor */ - if (do_count) + if (subflags.do_count) curwin->w_cursor = old_cursor; if (sub_nsubs > start_nsubs) @@ -5791,20 +5809,22 @@ outofmem: if (!global_busy) { - if (!do_ask) /* when interactive leave cursor on the match */ + /* when interactive leave cursor on the match */ + if (!subflags.do_ask) { if (endcolumn) coladvance((colnr_T)MAXCOL); else beginline(BL_WHITE | BL_FIX); } - if (!do_sub_msg(do_count) && do_ask) + if (!do_sub_msg(subflags.do_count) && subflags.do_ask) MSG(""); } else global_need_beginline = TRUE; - if (do_print) - print_line(curwin->w_cursor.lnum, do_number, do_list); + if (subflags.do_print) + print_line(curwin->w_cursor.lnum, + subflags.do_number, subflags.do_list); } else if (!global_busy) { @@ -5812,12 +5832,12 @@ outofmem: EMSG(_(e_interr)); else if (got_match) /* did find something but nothing substituted */ MSG(""); - else if (do_error) /* nothing found */ + else if (subflags.do_error) /* nothing found */ EMSG2(_(e_patnotf2), get_search_pat()); } #ifdef FEAT_FOLDING - if (do_ask && hasAnyFolding(curwin)) + if (subflags.do_ask && hasAnyFolding(curwin)) /* Cursor position may require updating */ changed_window_setting(); #endif @@ -5825,8 +5845,8 @@ outofmem: vim_regfree(regmatch.regprog); /* Restore the flag values, they can be used for ":&&". */ - do_all = save_do_all; - do_ask = save_do_ask; + subflags.do_all = save_do_all; + subflags.do_ask = save_do_ask; } /* diff --git a/src/getchar.c b/src/getchar.c index 92528cc7df..951dddbe64 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3060,7 +3060,7 @@ inchar( if (typebuf_changed(tb_change_cnt)) return 0; - return fix_input_buffer(buf, len, script_char >= 0); + return fix_input_buffer(buf, len); } /* @@ -3069,10 +3069,7 @@ inchar( * Returns the new length. */ int -fix_input_buffer( - char_u *buf, - int len, - int script) /* TRUE when reading from a script */ +fix_input_buffer(char_u *buf, int len) { int i; char_u *p = buf; @@ -3083,7 +3080,6 @@ fix_input_buffer( * Replace NUL by K_SPECIAL KS_ZERO KE_FILLER * Replace K_SPECIAL by K_SPECIAL KS_SPECIAL KE_FILLER * Replace CSI by K_SPECIAL KS_EXTRA KE_CSI - * Don't replace K_SPECIAL when reading a script file. */ for (i = len; --i >= 0; ++p) { @@ -3106,7 +3102,7 @@ fix_input_buffer( } else #endif - if (p[0] == NUL || (p[0] == K_SPECIAL && !script + if (p[0] == NUL || (p[0] == K_SPECIAL #ifdef FEAT_AUTOCMD /* timeout may generate K_CURSORHOLD */ && (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD) diff --git a/src/globals.h b/src/globals.h index f04ca4a480..d8a2527fe4 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1513,7 +1513,7 @@ EXTERN char_u e_notread[] INIT(= N_("E485: Can't read file %s")); EXTERN char_u e_nowrtmsg[] INIT(= N_("E37: No write since last change (add ! to override)")); EXTERN char_u e_nowrtmsg_nobang[] INIT(= N_("E37: No write since last change")); EXTERN char_u e_null[] INIT(= N_("E38: Null argument")); -#ifdef FEAT_DIGRAPHS +#if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS) EXTERN char_u e_number_exp[] INIT(= N_("E39: Number expected")); #endif #ifdef FEAT_QUICKFIX diff --git a/src/gui.c b/src/gui.c index 12661e4c53..a1c04b66e8 100644 --- a/src/gui.c +++ b/src/gui.c @@ -1981,12 +1981,13 @@ gui_write( * gui_can_update_cursor() afterwards. */ void -gui_dont_update_cursor(void) +gui_dont_update_cursor(int undraw) { if (gui.in_use) { /* Undraw the cursor now, we probably can't do it after the change. */ - gui_undraw_cursor(); + if (undraw) + gui_undraw_cursor(); can_update_cursor = FALSE; } } diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 7c63a49fc6..ee73db3390 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -5239,7 +5239,7 @@ static PangoEngineShape *default_shape_engine = NULL; static void ascii_glyph_table_init(void) { - char_u ascii_chars[128]; + char_u ascii_chars[2 * 128]; PangoAttrList *attr_list; GList *item_list; int i; @@ -5252,12 +5252,16 @@ ascii_glyph_table_init(void) gui.ascii_glyphs = NULL; gui.ascii_font = NULL; - /* For safety, fill in question marks for the control characters. */ - for (i = 0; i < 32; ++i) - ascii_chars[i] = '?'; - for (; i < 127; ++i) - ascii_chars[i] = i; - ascii_chars[i] = '?'; + /* For safety, fill in question marks for the control characters. + * Put a space between characters to avoid shaping. */ + for (i = 0; i < 128; ++i) + { + if (i >= 32 && i < 127) + ascii_chars[2 * i] = i; + else + ascii_chars[2 * i] = '?'; + ascii_chars[2 * i + 1] = ' '; + } attr_list = pango_attr_list_new(); item_list = pango_itemize(gui.text_context, (const char *)ascii_chars, @@ -5946,7 +5950,7 @@ gui_gtk2_draw_string(int row, int col, char_u *s, int len, int flags) for (i = 0; i < len; ++i) { - glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[s[i]]; + glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[2 * s[i]]; glyphs->log_clusters[i] = i; } @@ -6698,7 +6702,7 @@ check_copy_area(void) * we don't want it to be. I'm not sure if it's correct to call * gui_dont_update_cursor() at this point but it works as a quick * fix for now. */ - gui_dont_update_cursor(); + gui_dont_update_cursor(TRUE); do { diff --git a/src/gui_mac.c b/src/gui_mac.c index b78c903bea..d750b3b1b6 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -4830,7 +4830,7 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx) char_u *p_actext; p_actext = menu->actext; - key = find_special_key(&p_actext, &modifiers, FALSE, FALSE); + key = find_special_key(&p_actext, &modifiers, FALSE, FALSE, FALSE); if (*p_actext != 0) key = 0; /* error: trailing text */ /* find_special_key() returns a keycode with as many of the diff --git a/src/message.c b/src/message.c index 149c30ab3d..3dec41f738 100644 --- a/src/message.c +++ b/src/message.c @@ -3891,7 +3891,7 @@ do_browse( static char *e_printf = N_("E766: Insufficient arguments for printf()"); static varnumber_T tv_nr(typval_T *tvs, int *idxp); -static char *tv_str(typval_T *tvs, int *idxp); +static char *tv_str(typval_T *tvs, int *idxp, char_u **tofree); # ifdef FEAT_FLOAT static double tv_float(typval_T *tvs, int *idxp); # endif @@ -3920,20 +3920,28 @@ tv_nr(typval_T *tvs, int *idxp) /* * Get string argument from "idxp" entry in "tvs". First entry is 1. + * If "tofree" is NULL get_tv_string_chk() is used. Some types (e.g. List) + * are not converted to a string. + * If "tofree" is not NULL echo_string() is used. All types are converted to + * a string with the same format as ":echo". The caller must free "*tofree". * Returns NULL for an error. */ static char * -tv_str(typval_T *tvs, int *idxp) +tv_str(typval_T *tvs, int *idxp, char_u **tofree) { - int idx = *idxp - 1; - char *s = NULL; + int idx = *idxp - 1; + char *s = NULL; + static char_u numbuf[NUMBUFLEN]; if (tvs[idx].v_type == VAR_UNKNOWN) EMSG(_(e_printf)); else { ++*idxp; - s = (char *)get_tv_string_chk(&tvs[idx]); + if (tofree != NULL) + s = (char *)echo_string(&tvs[idx], tofree, numbuf, get_copyID()); + else + s = (char *)get_tv_string_chk(&tvs[idx]); } return s; } @@ -4087,12 +4095,14 @@ vim_vsnprintf( char length_modifier = '\0'; /* temporary buffer for simple numeric->string conversion */ -# ifdef FEAT_FLOAT +# if defined(FEAT_FLOAT) # define TMP_LEN 350 /* On my system 1e308 is the biggest number possible. * That sounds reasonable to use as the maximum * printable. */ +# elif defined(FEAT_NUM64) +# define TMP_LEN 66 # else -# define TMP_LEN 32 +# define TMP_LEN 34 # endif char tmp[TMP_LEN]; @@ -4117,6 +4127,10 @@ vim_vsnprintf( /* current conversion specifier character */ char fmt_spec = '\0'; + /* buffer for 's' and 'S' specs */ + char_u *tofree = NULL; + + str_arg = NULL; p++; /* skip '%' */ @@ -4280,7 +4294,7 @@ vim_vsnprintf( case 'S': str_arg = # if defined(FEAT_EVAL) - tvs != NULL ? tv_str(tvs, &arg_idx) : + tvs != NULL ? tv_str(tvs, &arg_idx, &tofree) : # endif va_arg(ap, char *); if (str_arg == NULL) @@ -4335,9 +4349,13 @@ vim_vsnprintf( } break; - case 'd': case 'u': case 'o': case 'x': case 'X': case 'p': + case 'd': case 'u': + case 'b': case 'B': + case 'o': + case 'x': case 'X': + case 'p': { - /* NOTE: the u, o, x, X and p conversion specifiers + /* NOTE: the u, b, o, x, X and p conversion specifiers * imply the value is unsigned; d implies a signed * value */ @@ -4362,6 +4380,9 @@ vim_vsnprintf( uvarnumber_T ullong_arg = 0; # endif + /* only defined for b convertion */ + uvarnumber_T bin_arg = 0; + /* pointer argument value -only defined for p * conversion */ void *ptr_arg = NULL; @@ -4371,12 +4392,24 @@ vim_vsnprintf( length_modifier = '\0'; ptr_arg = # if defined(FEAT_EVAL) - tvs != NULL ? (void *)tv_str(tvs, &arg_idx) : + tvs != NULL ? (void *)tv_str(tvs, &arg_idx, + NULL) : # endif va_arg(ap, void *); if (ptr_arg != NULL) arg_sign = 1; } + else if (fmt_spec == 'b' || fmt_spec == 'B') + { + bin_arg = +# if defined(FEAT_EVAL) + tvs != NULL ? + (uvarnumber_T)tv_nr(tvs, &arg_idx) : +# endif + va_arg(ap, uvarnumber_T); + if (bin_arg != 0) + arg_sign = 1; + } else if (fmt_spec == 'd') { /* signed */ @@ -4483,7 +4516,8 @@ vim_vsnprintf( else if (alternate_form) { if (arg_sign != 0 - && (fmt_spec == 'x' || fmt_spec == 'X') ) + && (fmt_spec == 'b' || fmt_spec == 'B' + || fmt_spec == 'x' || fmt_spec == 'X') ) { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = fmt_spec; @@ -4499,7 +4533,7 @@ vim_vsnprintf( { /* When zero value is formatted with an explicit * precision 0, the resulting formatted string is - * empty (d, i, u, o, x, X, p). */ + * empty (d, i, u, b, B, o, x, X, p). */ } else { @@ -4532,6 +4566,22 @@ vim_vsnprintf( if (fmt_spec == 'p') str_arg_l += sprintf(tmp + str_arg_l, f, ptr_arg); + else if (fmt_spec == 'b' || fmt_spec == 'B') + { + char b[8 * sizeof(uvarnumber_T)]; + size_t b_l = 0; + uvarnumber_T bn = bin_arg; + + do + { + b[sizeof(b) - ++b_l] = '0' + (bn & 0x1); + bn >>= 1; + } + while (bn != 0); + + memcpy(tmp + str_arg_l, b + sizeof(b) - b_l, b_l); + str_arg_l += b_l; + } else if (fmt_spec == 'd') { /* signed */ @@ -4881,6 +4931,7 @@ vim_vsnprintf( str_l += pn; } } + vim_free(tofree); } } diff --git a/src/misc1.c b/src/misc1.c index df4f849543..383b0cc5f0 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -3416,7 +3416,7 @@ get_keystroke(void) if (n > 0) { /* Replace zero and CSI by a special key code. */ - n = fix_input_buffer(buf + len, n, FALSE); + n = fix_input_buffer(buf + len, n); len += n; waited = 0; } diff --git a/src/misc2.c b/src/misc2.c index d592a53144..c385c028c7 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -2680,13 +2680,14 @@ get_special_key_name(int c, int modifiers) trans_special( char_u **srcp, char_u *dst, - int keycode) /* prefer key code, e.g. K_DEL instead of DEL */ + int keycode, /* prefer key code, e.g. K_DEL instead of DEL */ + int in_string) /* TRUE when inside a double quoted string */ { int modifiers = 0; int key; int dlen = 0; - key = find_special_key(srcp, &modifiers, keycode, FALSE); + key = find_special_key(srcp, &modifiers, keycode, FALSE, in_string); if (key == 0) return 0; @@ -2726,7 +2727,8 @@ find_special_key( char_u **srcp, int *modp, int keycode, /* prefer key code, e.g. K_DEL instead of DEL */ - int keep_x_key) /* don't translate xHome to Home key */ + int keep_x_key, /* don't translate xHome to Home key */ + int in_string) /* TRUE in string, double quote is escaped */ { char_u *last_dash; char_u *end_of_name; @@ -2757,10 +2759,14 @@ find_special_key( else #endif l = 1; - /* Anything accepted, like , except , because the " - * ends the string. */ - if (bp[l] != '"' && bp[l + 1] == '>') + /* Anything accepted, like . + * or are not special in strings as " is + * the string delimiter. With a backslash it works: */ + if (!(in_string && bp[1] == '"') && bp[2] == '>') bp += l; + else if (in_string && bp[1] == '\\' && bp[2] == '"' + && bp[3] == '>') + bp += 2; } } if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) @@ -2804,20 +2810,22 @@ find_special_key( } else { - /* - * Modifier with single letter, or special key name. - */ + int off = 1; + + /* Modifier with single letter, or special key name. */ + if (in_string && last_dash[1] == '\\' && last_dash[2] == '"') + off = 2; #ifdef FEAT_MBYTE if (has_mbyte) - l = mb_ptr2len(last_dash + 1); + l = mb_ptr2len(last_dash + off); else #endif l = 1; - if (modifiers != 0 && last_dash[l + 1] == '>') - key = PTR2CHAR(last_dash + 1); + if (modifiers != 0 && last_dash[l + off] == '>') + key = PTR2CHAR(last_dash + off); else { - key = get_special_key_code(last_dash + 1); + key = get_special_key_code(last_dash + off); if (!keep_x_key) key = handle_x_keys(key); } diff --git a/src/move.c b/src/move.c index 2a0e2c08ef..c5c2a73709 100644 --- a/src/move.c +++ b/src/move.c @@ -919,12 +919,7 @@ win_col_off(win_T *wp) + wp->w_p_fdc #endif #ifdef FEAT_SIGNS - + ( -# ifdef FEAT_NETBEANS_INTG - /* show glyph gutter in netbeans */ - wp->w_buffer->b_has_sign_column || -# endif - wp->w_buffer->b_signlist != NULL ? 2 : 0) + + (signcolumn_on(wp) ? 2 : 0) #endif ); } diff --git a/src/option.c b/src/option.c index 29e452960c..44a56a2c6e 100644 --- a/src/option.c +++ b/src/option.c @@ -256,6 +256,9 @@ # define PV_COCU OPT_WIN(WV_COCU) # define PV_COLE OPT_WIN(WV_COLE) #endif +#ifdef FEAT_SIGNS +# define PV_SCL OPT_WIN(WV_SCL) +#endif /* WV_ and BV_ values get typecasted to this for the "indir" field */ typedef enum @@ -474,7 +477,7 @@ struct vimoption #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \ || defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \ || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL) -# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn" +# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn" #else # define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill" #endif @@ -2458,6 +2461,15 @@ static struct vimoption options[] = {"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}, + {"signcolumn", "scl", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN, +#ifdef FEAT_SIGNS + (char_u *)VAR_WIN, PV_SCL, + {(char_u *)"auto", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"slowopen", "slow", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, @@ -3131,6 +3143,9 @@ static char *(p_fcl_values[]) = {"all", NULL}; #ifdef FEAT_INS_EXPAND static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "noinsert", "noselect", NULL}; #endif +#ifdef FEAT_SIGNS +static char *(p_scl_values[]) = {"yes", "no", "auto", NULL}; +#endif static void set_option_default(int, int opt_flags, int compatible); static void set_options_default(int opt_flags); @@ -7063,6 +7078,15 @@ did_set_string_option( } #endif /* FEAT_INS_EXPAND */ +#ifdef FEAT_SIGNS + /* 'signcolumn' */ + else if (varp == &curwin->w_p_scl) + { + if (check_opt_strings(*varp, p_scl_values, FALSE) != OK) + errmsg = e_invarg; + } +#endif + #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) else if (varp == &p_toolbar) @@ -9620,7 +9644,7 @@ find_key_option(char_u *arg) { --arg; /* put arg at the '<' */ modifiers = 0; - key = find_special_key(&arg, &modifiers, TRUE, TRUE); + key = find_special_key(&arg, &modifiers, TRUE, TRUE, FALSE); if (modifiers) /* can't handle modifiers here */ key = 0; } @@ -10601,6 +10625,9 @@ get_varp(struct vimoption *p) case PV_WM: return (char_u *)&(curbuf->b_p_wm); #ifdef FEAT_KEYMAP case PV_KMAP: return (char_u *)&(curbuf->b_p_keymap); +#endif +#ifdef FEAT_SIGNS + case PV_SCL: return (char_u *)&(curwin->w_p_scl); #endif default: EMSG(_("E356: get_varp ERROR")); } @@ -10717,6 +10744,9 @@ copy_winopt(winopt_T *from, winopt_T *to) to->wo_fdt = vim_strsave(from->wo_fdt); # endif to->wo_fmr = vim_strsave(from->wo_fmr); +#endif +#ifdef FEAT_SIGNS + to->wo_scl = vim_strsave(from->wo_scl); #endif check_winopt(to); /* don't want NULL pointers */ } @@ -10747,6 +10777,9 @@ check_winopt(winopt_T *wop UNUSED) # endif check_string_option(&wop->wo_fmr); #endif +#ifdef FEAT_SIGNS + check_string_option(&wop->wo_scl); +#endif #ifdef FEAT_RIGHTLEFT check_string_option(&wop->wo_rlc); #endif @@ -10780,6 +10813,9 @@ clear_winopt(winopt_T *wop UNUSED) # endif clear_string_option(&wop->wo_fmr); #endif +#ifdef FEAT_SIGNS + clear_string_option(&wop->wo_scl); +#endif #ifdef FEAT_LINEBREAK clear_string_option(&wop->wo_briopt); #endif @@ -12538,3 +12574,59 @@ get_bkc_value(buf_T *buf) { return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags; } + +#if defined(FEAT_SIGNS) || defined(PROTO) +/* + * Return TRUE when window "wp" has a column to draw signs in. + */ + int +signcolumn_on(win_T *wp) +{ + if (*wp->w_p_scl == 'n') + return FALSE; + if (*wp->w_p_scl == 'y') + return TRUE; + return (wp->w_buffer->b_signlist != NULL +# ifdef FEAT_NETBEANS_INTG + || wp->w_buffer->b_has_sign_column +# endif + ); +} +#endif + +#if defined(FEAT_EVAL) || defined(PROTO) +/* + * Get window or buffer local options. + */ + dict_T * +get_winbuf_options(int bufopt) +{ + dict_T *d; + int opt_idx; + + d = dict_alloc(); + if (d == NULL) + return NULL; + + for (opt_idx = 0; !istermoption(&options[opt_idx]); opt_idx++) + { + struct vimoption *opt = &options[opt_idx]; + + if ((bufopt && (opt->indir & PV_BUF)) + || (!bufopt && (opt->indir & PV_WIN))) + { + char_u *varp = get_varp(opt); + + if (varp != NULL) + { + if (opt->flags & P_STRING) + dict_add_nr_str(d, opt->fullname, 0L, *(char_u **)varp); + else + dict_add_nr_str(d, opt->fullname, *varp, NULL); + } + } + } + + return d; +} +#endif diff --git a/src/option.h b/src/option.h index 1b5d3a3c2a..238c81bb65 100644 --- a/src/option.h +++ b/src/option.h @@ -648,6 +648,9 @@ EXTERN int p_magic; /* 'magic' */ EXTERN char_u *p_mef; /* 'makeef' */ EXTERN char_u *p_mp; /* 'makeprg' */ #endif +#ifdef FEAT_SIGNS +EXTERN char_u *p_scl; /* signcolumn */ +#endif #ifdef FEAT_SYN_HL EXTERN char_u *p_cc; /* 'colorcolumn' */ EXTERN int p_cc_cols[256]; /* array for 'colorcolumn' columns */ @@ -1195,6 +1198,9 @@ enum , WV_WFW #endif , WV_WRAP +#ifdef FEAT_SIGNS + , WV_SCL +#endif , WV_COUNT /* must be the last one */ }; diff --git a/src/os_unix.c b/src/os_unix.c index cc7772ea0b..e83acdd563 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2261,7 +2261,11 @@ vim_is_xterm(char_u *name) use_xterm_like_mouse(char_u *name) { return (name != NULL - && (term_is_xterm || STRNICMP(name, "screen", 6) == 0)); + && (term_is_xterm + || STRNICMP(name, "screen", 6) == 0 + || STRICMP(name, "st") == 0 + || STRNICMP(name, "st-", 3) == 0 + || STRNICMP(name, "stterm", 6) == 0)); } #endif diff --git a/src/proto/dict.pro b/src/proto/dict.pro index 10a5b6bf1d..61f4dfa5b2 100644 --- a/src/proto/dict.pro +++ b/src/proto/dict.pro @@ -11,6 +11,7 @@ dict_T *dict_copy(dict_T *orig, int deep, int copyID); int dict_add(dict_T *d, dictitem_T *item); int dict_add_nr_str(dict_T *d, char *key, varnumber_T nr, char_u *str); int dict_add_list(dict_T *d, char *key, list_T *list); +int dict_add_dict(dict_T *d, char *key, dict_T *dict); long dict_len(dict_T *d); dictitem_T *dict_find(dict_T *d, char_u *key, int len); char_u *get_dict_string(dict_T *d, char_u *key, int save); diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro index dc117b0aca..de33bfd147 100644 --- a/src/proto/getchar.pro +++ b/src/proto/getchar.pro @@ -47,7 +47,7 @@ int vpeekc_nomap(void); int vpeekc_any(void); int char_avail(void); void vungetc(int c); -int fix_input_buffer(char_u *buf, int len, int script); +int fix_input_buffer(char_u *buf, int len); int input_available(void); int do_map(int maptype, char_u *arg, int mode, int abbrev); int get_map_mode(char_u **cmdp, int forceit); diff --git a/src/proto/gui.pro b/src/proto/gui.pro index 7a0176f5b6..26466ae025 100644 --- a/src/proto/gui.pro +++ b/src/proto/gui.pro @@ -23,7 +23,7 @@ void gui_stop_highlight(int mask); void gui_clear_block(int row1, int col1, int row2, int col2); void gui_update_cursor_later(void); void gui_write(char_u *s, int len); -void gui_dont_update_cursor(void); +void gui_dont_update_cursor(int undraw); void gui_can_update_cursor(void); int gui_outstr_nowrap(char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back); void gui_undraw_cursor(void); diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro index 573dee559e..70c7dae5b6 100644 --- a/src/proto/misc2.pro +++ b/src/proto/misc2.pro @@ -64,8 +64,8 @@ int name_to_mod_mask(int c); int simplify_key(int key, int *modifiers); int handle_x_keys(int key); char_u *get_special_key_name(int c, int modifiers); -int trans_special(char_u **srcp, char_u *dst, int keycode); -int find_special_key(char_u **srcp, int *modp, int keycode, int keep_x_key); +int trans_special(char_u **srcp, char_u *dst, int keycode, int in_string); +int find_special_key(char_u **srcp, int *modp, int keycode, int keep_x_key, int in_string); int extract_modifiers(int key, int *modp); int find_special_key_in_table(int c); int get_special_key_code(char_u *name); diff --git a/src/proto/option.pro b/src/proto/option.pro index d0ba4ec27f..8c9bde583a 100644 --- a/src/proto/option.pro +++ b/src/proto/option.pro @@ -63,4 +63,6 @@ long get_sw_value(buf_T *buf); long get_sts_value(void); void find_mps_values(int *initc, int *findc, int *backwards, int switchit); unsigned int get_bkc_value(buf_T *buf); +int signcolumn_on(win_T *wp); +dict_T *get_winbuf_options(int bufopt); /* vim: set ft=c : */ diff --git a/src/proto/quickfix.pro b/src/proto/quickfix.pro index 02c2d9831b..99f5edeefd 100644 --- a/src/proto/quickfix.pro +++ b/src/proto/quickfix.pro @@ -27,8 +27,9 @@ void ex_cnext(exarg_T *eap); void ex_cfile(exarg_T *eap); void ex_vimgrep(exarg_T *eap); char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags); -int get_errorlist(win_T *wp, list_T *list); -int set_errorlist(win_T *wp, list_T *list, int action, char_u *title); +int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict); +int get_errorlist(win_T *wp, int qf_idx, list_T *list); +int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, dict_T *what); void ex_cbuffer(exarg_T *eap); void ex_cexpr(exarg_T *eap); void ex_helpgrep(exarg_T *eap); diff --git a/src/proto/window.pro b/src/proto/window.pro index e091e34ad8..d82988e30b 100644 --- a/src/proto/window.pro +++ b/src/proto/window.pro @@ -4,6 +4,7 @@ void get_wincmd_addr_type(char_u *arg, exarg_T *eap); int win_split(int size, int flags); int win_split_ins(int size, int flags, win_T *new_wp, int dir); int win_valid(win_T *win); +int win_valid_any_tab(win_T *win); int win_count(void); int make_windows(int count, int vertical); void win_move_after(win_T *win1, win_T *win2); @@ -86,6 +87,7 @@ int get_tab_number(tabpage_T *tp); int win_getid(typval_T *argvars); int win_gotoid(typval_T *argvars); void win_id2tabwin(typval_T *argvars, list_T *list); +win_T *win_id2wp(typval_T *argvars); int win_id2win(typval_T *argvars); void win_findbuf(typval_T *argvars, list_T *list); /* vim: set ft=c : */ diff --git a/src/quickfix.c b/src/quickfix.c index aa94ae69a3..2fa6ed98a9 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -3140,6 +3140,24 @@ qf_find_buf(qf_info_T *qi) return NULL; } +/* + * Update the w:quickfix_title variable in the quickfix/location list window + */ + static void +qf_update_win_titlevar(qf_info_T *qi) +{ + win_T *win; + win_T *curwin_save; + + if ((win = qf_find_win(qi)) != NULL) + { + curwin_save = curwin; + curwin = win; + qf_set_title_var(qi); + curwin = curwin_save; + } +} + /* * Find the quickfix buffer. If it exists, update the contents. */ @@ -3148,7 +3166,6 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) { buf_T *buf; win_T *win; - win_T *curwin_save; aco_save_T aco; /* Check if a buffer for the quickfix list exists. Update it. */ @@ -3161,13 +3178,7 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) /* set curwin/curbuf to buf and save a few things */ aucmd_prepbuf(&aco, buf); - if ((win = qf_find_win(qi)) != NULL) - { - curwin_save = curwin; - curwin = win; - qf_set_title_var(qi); - curwin = curwin_save; - } + qf_update_win_titlevar(qi); qf_fill_buffer(qi, buf, old_last); @@ -4532,9 +4543,10 @@ unload_dummy_buffer(buf_T *buf, char_u *dirname_start) #if defined(FEAT_EVAL) || defined(PROTO) /* * Add each quickfix error to list "list" as a dictionary. + * If qf_idx is -1, use the current list. Otherwise, use the specified list. */ int -get_errorlist(win_T *wp, list_T *list) +get_errorlist(win_T *wp, int qf_idx, list_T *list) { qf_info_T *qi = &ql_info; dict_T *dict; @@ -4550,12 +4562,15 @@ get_errorlist(win_T *wp, list_T *list) return FAIL; } - if (qi->qf_curlist >= qi->qf_listcount - || qi->qf_lists[qi->qf_curlist].qf_count == 0) + if (qf_idx == -1) + qf_idx = qi->qf_curlist; + + if (qf_idx >= qi->qf_listcount + || qi->qf_lists[qf_idx].qf_count == 0) return FAIL; - qfp = qi->qf_lists[qi->qf_curlist].qf_start; - for (i = 1; !got_int && i <= qi->qf_lists[qi->qf_curlist].qf_count; ++i) + qfp = qi->qf_lists[qf_idx].qf_start; + for (i = 1; !got_int && i <= qi->qf_lists[qf_idx].qf_count; ++i) { /* Handle entries with a non-existing buffer number. */ bufnum = qfp->qf_fnum; @@ -4590,16 +4605,93 @@ get_errorlist(win_T *wp, list_T *list) } /* - * Populate the quickfix list with the items supplied in the list - * of dictionaries. "title" will be copied to w:quickfix_title. - * "action" is 'a' for add, 'r' for replace. Otherwise create a new list. + * Flags used by getqflist()/getloclist() to determine which fields to return. + */ +enum { + QF_GETLIST_NONE = 0x0, + QF_GETLIST_TITLE = 0x1, + QF_GETLIST_ITEMS = 0x2, + QF_GETLIST_NR = 0x4, + QF_GETLIST_WINID = 0x8, + QF_GETLIST_ALL = 0xFF +}; + +/* + * Return quickfix/location list details (title) as a + * dictionary. 'what' contains the details to return. If 'list_idx' is -1, + * then current list is used. Otherwise the specified list is used. */ int -set_errorlist( - win_T *wp, - list_T *list, - int action, - char_u *title) +get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict) +{ + qf_info_T *qi = &ql_info; + int status = OK; + int qf_idx; + dictitem_T *di; + int flags = QF_GETLIST_NONE; + + if (wp != NULL) + { + qi = GET_LOC_LIST(wp); + if (qi == NULL) + return FAIL; + } + + qf_idx = qi->qf_curlist; /* default is the current list */ + if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL) + { + /* Use the specified quickfix/location list */ + if (di->di_tv.v_type == VAR_NUMBER) + { + qf_idx = di->di_tv.vval.v_number - 1; + if (qf_idx < 0 || qf_idx >= qi->qf_listcount) + return FAIL; + flags |= QF_GETLIST_NR; + } + else + return FAIL; + } + + if (dict_find(what, (char_u *)"all", -1) != NULL) + flags |= QF_GETLIST_ALL; + + if (dict_find(what, (char_u *)"title", -1) != NULL) + flags |= QF_GETLIST_TITLE; + + if (dict_find(what, (char_u *)"winid", -1) != NULL) + flags |= QF_GETLIST_WINID; + + if (flags & QF_GETLIST_TITLE) + { + char_u *t; + t = qi->qf_lists[qf_idx].qf_title; + if (t == NULL) + t = (char_u *)""; + status = dict_add_nr_str(retdict, "title", 0L, t); + } + if ((status == OK) && (flags & QF_GETLIST_NR)) + status = dict_add_nr_str(retdict, "nr", qf_idx + 1, NULL); + if ((status == OK) && (flags & QF_GETLIST_WINID)) + { + win_T *win; + win = qf_find_win(qi); + if (win != NULL) + status = dict_add_nr_str(retdict, "winid", win->w_id, NULL); + } + + return status; +} + +/* + * Add list of entries to quickfix/location list. Each list entry is + * a dictionary with item information. + */ + static int +qf_add_entries( + qf_info_T *qi, + list_T *list, + char_u *title, + int action) { listitem_T *li; dict_T *d; @@ -4613,16 +4705,8 @@ set_errorlist( #endif int valid, status; int retval = OK; - qf_info_T *qi = &ql_info; int did_bufnr_emsg = FALSE; - if (wp != NULL) - { - qi = ll_get_or_alloc_list(wp); - if (qi == NULL) - return FAIL; - } - if (action == ' ' || qi->qf_curlist == qi->qf_listcount) /* make place for a new list */ qf_new_list(qi, title); @@ -4719,6 +4803,74 @@ set_errorlist( return retval; } + + static int +qf_set_properties(qf_info_T *qi, dict_T *what) +{ + dictitem_T *di; + int retval = FAIL; + int qf_idx; + + qf_idx = qi->qf_curlist; /* default is the current list */ + if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL) + { + /* Use the specified quickfix/location list */ + if (di->di_tv.v_type == VAR_NUMBER) + { + qf_idx = di->di_tv.vval.v_number - 1; + if (qf_idx < 0 || qf_idx >= qi->qf_listcount) + return FAIL; + } + else + return FAIL; + } + + if ((di = dict_find(what, (char_u *)"title", -1)) != NULL) + { + if (di->di_tv.v_type == VAR_STRING) + { + vim_free(qi->qf_lists[qf_idx].qf_title); + qi->qf_lists[qf_idx].qf_title = + get_dict_string(what, (char_u *)"title", TRUE); + if (qf_idx == qi->qf_curlist) + qf_update_win_titlevar(qi); + retval = OK; + } + } + + return retval; +} + +/* + * Populate the quickfix list with the items supplied in the list + * of dictionaries. "title" will be copied to w:quickfix_title. + * "action" is 'a' for add, 'r' for replace. Otherwise create a new list. + */ + int +set_errorlist( + win_T *wp, + list_T *list, + int action, + char_u *title, + dict_T *what) +{ + qf_info_T *qi = &ql_info; + int retval = OK; + + if (wp != NULL) + { + qi = ll_get_or_alloc_list(wp); + if (qi == NULL) + return FAIL; + } + + if (what != NULL) + retval = qf_set_properties(qi, what); + else + retval = qf_add_entries(qi, list, title, action); + + return retval; +} #endif /* diff --git a/src/screen.c b/src/screen.c index 961093e05d..90ff60a024 100644 --- a/src/screen.c +++ b/src/screen.c @@ -498,6 +498,7 @@ update_screen(int type) int did_one; #endif #ifdef FEAT_GUI + int did_undraw = FALSE; int gui_cursor_col; int gui_cursor_row; #endif @@ -697,11 +698,12 @@ update_screen(int type) /* Remove the cursor before starting to do anything, because * scrolling may make it difficult to redraw the text under * it. */ - if (gui.in_use) + if (gui.in_use && wp == curwin) { gui_cursor_col = gui.cursor_col; gui_cursor_row = gui.cursor_row; gui_undraw_cursor(); + did_undraw = TRUE; } #endif } @@ -757,7 +759,7 @@ update_screen(int type) if (gui.in_use) { out_flush(); /* required before updating the cursor */ - if (did_one && !gui_mch_is_blink_off()) + if (did_undraw && !gui_mch_is_blink_off()) { /* Put the GUI position where the cursor was, gui_update_cursor() * uses that. */ @@ -2203,7 +2205,7 @@ win_update(win_T *wp) /* make sure the rest of the screen is blank */ /* put '~'s on rows that aren't part of the file. */ - win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_AT); + win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_EOB); } /* Reset the type of redrawing required, the window has been updated. */ @@ -2253,23 +2255,6 @@ win_update(win_T *wp) #endif } -#ifdef FEAT_SIGNS -static int draw_signcolumn(win_T *wp); - -/* - * Return TRUE when window "wp" has a column to draw signs in. - */ - static int -draw_signcolumn(win_T *wp) -{ - return (wp->w_buffer->b_signlist != NULL -# ifdef FEAT_NETBEANS_INTG - || wp->w_buffer->b_has_sign_column -# endif - ); -} -#endif - /* * Clear the rest of the window and mark the unused lines with "c1". use "c2" * as the filler character. @@ -2311,7 +2296,7 @@ win_draw_end( } # endif # ifdef FEAT_SIGNS - if (draw_signcolumn(wp)) + if (signcolumn_on(wp)) { int nn = n + 2; @@ -2361,7 +2346,7 @@ win_draw_end( } #endif #ifdef FEAT_SIGNS - if (draw_signcolumn(wp)) + if (signcolumn_on(wp)) { int nn = n + 2; @@ -2505,7 +2490,7 @@ fold_line( #ifdef FEAT_SIGNS /* If signs are being displayed, add two spaces. */ - if (draw_signcolumn(wp)) + if (signcolumn_on(wp)) { len = W_WIDTH(wp) - col; if (len > 0) @@ -3557,6 +3542,7 @@ win_line( shl->startcol = MAXCOL; shl->endcol = MAXCOL; shl->attr_cur = 0; + shl->is_addpos = FALSE; v = (long)(ptr - line); if (cur != NULL) cur->pos.cur = 0; @@ -3675,7 +3661,7 @@ win_line( draw_state = WL_SIGN; /* Show the sign column when there are any signs in this * buffer or when using Netbeans. */ - if (draw_signcolumn(wp)) + if (signcolumn_on(wp)) { int text_sign; # ifdef FEAT_SIGN_ICONS @@ -5145,14 +5131,14 @@ win_line( * needed when a '$' was displayed for 'list'. */ #ifdef FEAT_SEARCH_EXTRA prevcol_hl_flag = FALSE; - if (prevcol == (long)search_hl.startcol) + if (!search_hl.is_addpos && prevcol == (long)search_hl.startcol) prevcol_hl_flag = TRUE; else { cur = wp->w_match_head; while (cur != NULL) { - if (prevcol == (long)cur->hl.startcol) + if (!cur->hl.is_addpos && prevcol == (long)cur->hl.startcol) { prevcol_hl_flag = TRUE; break; @@ -5227,7 +5213,8 @@ win_line( } else shl = &cur->hl; - if ((ptr - line) - 1 == (long)shl->startcol) + if ((ptr - line) - 1 == (long)shl->startcol + && (shl == &search_hl || !shl->is_addpos)) char_attr = shl->attr; if (shl != &search_hl && cur != NULL) cur = cur->next; @@ -7843,6 +7830,7 @@ next_search_hl_pos( shl->rm.startpos[0].col = start; shl->rm.endpos[0].lnum = 0; shl->rm.endpos[0].col = end; + shl->is_addpos = TRUE; posmatch->cur = bot + 1; return TRUE; } @@ -9707,7 +9695,7 @@ screen_ins_lines( #ifdef FEAT_GUI /* Don't update the GUI cursor here, ScreenLines[] is invalid until the * scrolling is actually carried out. */ - gui_dont_update_cursor(); + gui_dont_update_cursor(row + off <= gui.cursor_row); #endif if (*T_CCS != NUL) /* cursor relative to region */ @@ -9809,10 +9797,10 @@ screen_ins_lines( } /* - * delete lines on the screen and update ScreenLines[] - * 'end' is the line after the scrolled part. Normally it is Rows. - * When scrolling region used 'off' is the offset from the top for the region. - * 'row' and 'end' are relative to the start of the region. + * Delete lines on the screen and update ScreenLines[]. + * "end" is the line after the scrolled part. Normally it is Rows. + * When scrolling region used "off" is the offset from the top for the region. + * "row" and "end" are relative to the start of the region. * * Return OK for success, FAIL if the lines are not deleted. */ @@ -9928,7 +9916,8 @@ screen_del_lines( #ifdef FEAT_GUI /* Don't update the GUI cursor here, ScreenLines[] is invalid until the * scrolling is actually carried out. */ - gui_dont_update_cursor(); + gui_dont_update_cursor(gui.cursor_row >= row + off + && gui.cursor_row < end + off); #endif if (*T_CCS != NUL) /* cursor relative to region */ diff --git a/src/structs.h b/src/structs.h index a623339763..fbd01f3831 100644 --- a/src/structs.h +++ b/src/structs.h @@ -263,6 +263,10 @@ typedef struct int wo_crb_save; /* 'cursorbind' state saved for diff mode*/ # define w_p_crb_save w_onebuf_opt.wo_crb_save #endif +#ifdef FEAT_SIGNS + char_u *wo_scl; +# define w_p_scl w_onebuf_opt.wo_scl /* 'signcolumn' */ +#endif #ifdef FEAT_EVAL int wo_scriptID[WV_COUNT]; /* SIDs for window-local options */ @@ -2447,6 +2451,8 @@ typedef struct linenr_T first_lnum; /* first lnum to search for multi-line pat */ colnr_T startcol; /* in win_line() points to char where HL starts */ colnr_T endcol; /* in win_line() points to char where HL ends */ + int is_addpos; /* position specified directly by + matchaddpos(). TRUE/FALSE */ #ifdef FEAT_RELTIME proftime_T tm; /* for a time limit */ #endif diff --git a/src/syntax.c b/src/syntax.c index a9c15335ab..427bed48f7 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6789,6 +6789,7 @@ static char *(highlight_init_both[]) = "StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"), CENT("StatusLineNC term=reverse cterm=reverse", "StatusLineNC term=reverse cterm=reverse gui=reverse"), + "default link EndOfBuffer NonText", #ifdef FEAT_WINDOWS CENT("VertSplit term=reverse cterm=reverse", "VertSplit term=reverse cterm=reverse gui=reverse"), @@ -7940,7 +7941,7 @@ do_highlight( */ for (p = arg, off = 0; off < 100 - 6 && *p; ) { - len = trans_special(&p, buf + off, FALSE); + len = trans_special(&p, buf + off, FALSE, FALSE); if (len > 0) /* recognized special char */ off += len; else /* copy as normal char */ diff --git a/src/tag.c b/src/tag.c index cfc2b51e6d..e388a438c3 100644 --- a/src/tag.c +++ b/src/tag.c @@ -916,7 +916,7 @@ do_tag( } vim_snprintf((char *)IObuff, IOSIZE, "ltag %s", tag); - set_errorlist(curwin, list, ' ', IObuff); + set_errorlist(curwin, list, ' ', IObuff, NULL); list_free(list); vim_free(fname); diff --git a/src/term.c b/src/term.c index 90505180a2..8d7f168a03 100644 --- a/src/term.c +++ b/src/term.c @@ -5435,7 +5435,7 @@ replace_termcodes( } #endif - slen = trans_special(&src, result + dlen, TRUE); + slen = trans_special(&src, result + dlen, TRUE, FALSE); if (slen) { dlen += slen; diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 0a5ee927b0..2762a398c1 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -98,7 +98,6 @@ SCRIPTS_ALL = \ test_insertcount.out \ test_listchars.out \ test_listlbr.out \ - test_mapping.out \ test_marks.out \ test_nested_function.out \ test_search_mbyte.out \ @@ -160,6 +159,7 @@ NEW_TESTS = test_arglist.res \ test_assert.res \ test_autochdir \ test_backspace_opt.res \ + test_bufwintabinfo.res \ test_cdo.res \ test_channel.res \ test_cmdline.res \ diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim index 8dd698478d..442ba2e4f5 100644 --- a/src/testdir/test_alot.vim +++ b/src/testdir/test_alot.vim @@ -23,6 +23,7 @@ source test_lambda.vim source test_lispwords.vim source test_match.vim source test_menu.vim +source test_mapping.vim source test_messages.vim source test_partial.vim source test_popup.vim diff --git a/src/testdir/test_bufwintabinfo.vim b/src/testdir/test_bufwintabinfo.vim new file mode 100644 index 0000000000..ec1f538417 --- /dev/null +++ b/src/testdir/test_bufwintabinfo.vim @@ -0,0 +1,85 @@ +" Tests for the getbufinfo(), getwininfo() and gettabinfo() functions + +function Test_getbufwintabinfo() + 1,$bwipeout + edit Xtestfile1 + edit Xtestfile2 + let buflist = getbufinfo() + call assert_equal(2, len(buflist)) + call assert_match('Xtestfile1', buflist[0].name) + call assert_match('Xtestfile2', getbufinfo('Xtestfile2')[0].name) + call assert_equal([], getbufinfo(2016)) + edit Xtestfile1 + hide edit Xtestfile2 + hide enew + call assert_equal(3, len(getbufinfo({'bufloaded':1}))) + + set tabstop&vim + let b:editor = 'vim' + let l = getbufinfo('%') + call assert_equal(bufnr('%'), l[0].nr) + call assert_equal(8, l[0].options.tabstop) + call assert_equal('vim', l[0].variables.editor) + call assert_notequal(-1, index(l[0].windows, bufwinid('%'))) + + if has('signs') + call append(0, ['Linux', 'Windows', 'Mac']) + sign define Mark text=>> texthl=Search + exe "sign place 2 line=3 name=Mark buffer=" . bufnr('%') + let l = getbufinfo('%') + call assert_equal(2, l[0].signs[0].id) + call assert_equal(3, l[0].signs[0].lnum) + call assert_equal('Mark', l[0].signs[0].name) + sign unplace * + sign undefine Mark + enew! + endif + + only + let w1_id = win_getid() + new + let w2_id = win_getid() + tabnew | let w3_id = win_getid() + new | let w4_id = win_getid() + new | let w5_id = win_getid() + call setwinvar(0, 'signal', 'green') + tabfirst + let winlist = getwininfo() + call assert_equal(5, len(winlist)) + call assert_equal(winbufnr(2), winlist[1].bufnum) + call assert_equal(winheight(2), winlist[1].height) + call assert_equal(1, winlist[2].nr) + if has('signs') + call assert_equal('auto', winlist[0].options.signcolumn) + endif + call assert_equal(2, winlist[3].tpnr) + call assert_equal('green', winlist[2].variables.signal) + call assert_equal(winwidth(1), winlist[0].width) + call assert_equal(w4_id, winlist[3].winid) + let winfo = getwininfo(w5_id)[0] + call assert_equal(2, winfo.tpnr) + call assert_equal([], getwininfo(3)) + + call settabvar(1, 'space', 'build') + let tablist = gettabinfo() + call assert_equal(2, len(tablist)) + call assert_equal(3, len(tablist[1].windows)) + call assert_equal(2, tablist[1].nr) + call assert_equal('build', tablist[0].variables.space) + call assert_equal(w2_id, tablist[0].windows[0]) + call assert_equal([], gettabinfo(3)) + + tabonly | only + + lexpr '' + lopen + copen + let winlist = getwininfo() + call assert_false(winlist[0].quickfix) + call assert_false(winlist[0].loclist) + call assert_true(winlist[1].quickfix) + call assert_true(winlist[1].loclist) + call assert_true(winlist[2].quickfix) + call assert_false(winlist[2].loclist) + wincmd t | only +endfunction diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index e2c1876934..3a35637b7e 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -94,6 +94,10 @@ func Test_getcompletion() call assert_true(index(l, 'runtest.vim') >= 0) let l = getcompletion('walk', 'file') call assert_equal([], l) + set wildignore=*.vim + let l = getcompletion('run', 'file', 1) + call assert_true(index(l, 'runtest.vim') < 0) + set wildignore& let l = getcompletion('ha', 'filetype') call assert_true(index(l, 'hamster') >= 0) diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index cd71c419a1..a7ad65eef4 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -136,6 +136,50 @@ function Test_printf_64bit() endif endfunc +function Test_printf_spec_s() + " number + call assert_equal("1234567890", printf('%s', 1234567890)) + + " string + call assert_equal("abcdefgi", printf('%s', "abcdefgi")) + + " float + if has('float') + call assert_equal("1.23", printf('%s', 1.23)) + endif + + " list + let value = [1, 'two', ['three', 4]] + call assert_equal(string(value), printf('%s', value)) + + " dict + let value = {'key1' : 'value1', 'key2' : ['list', 'value'], 'key3' : {'dict' : 'value'}} + call assert_equal(string(value), printf('%s', value)) + + " funcref + call assert_equal('printf', printf('%s', function('printf'))) + + " partial + call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s']))) +endfunc + +function Test_printf_spec_b() + call assert_equal("0", printf('%b', 0)) + call assert_equal("00001100", printf('%08b', 12)) + call assert_equal("11111111", printf('%08b', 0xff)) + call assert_equal(" 1111011", printf('%10b', 123)) + call assert_equal("0001111011", printf('%010b', 123)) + call assert_equal(" 0b1111011", printf('%#10b', 123)) + call assert_equal("0B01111011", printf('%#010B', 123)) + call assert_equal("1001001100101100000001011010010", printf('%b', 1234567890)) + if has('num64') + call assert_equal("11100000100100010000110000011011101111101111001", printf('%b', 123456789012345)) + call assert_equal("1111111111111111111111111111111111111111111111111111111111111111", printf('%b', -1)) + else + call assert_equal("11111111111111111111111111111111", printf('%b', -1)) + endif +endfunc + func Test_substitute_expr() let g:val = 'XXX' call assert_equal('XXX', substitute('yyy', 'y*', '\=g:val', '')) diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in deleted file mode 100644 index f900f421e2..0000000000 --- a/src/testdir/test_mapping.in +++ /dev/null @@ -1,72 +0,0 @@ -Test for mappings and abbreviations - -STARTTEST -:so small.vim -:so mbyte.vim -:set encoding=utf-8 -: " abbreviations with р (0x80) should work -:inoreab чкпр vim -GAчкпр - -:" mapping of ctrl-c in Insert mode -:set cpo-=< cpo-=k -:inoremap -:cnoremap dummy -:cunmap -GA -TEST2: CTRL-C |A| - -:unmap -:unmap! -:" -:" mapping of ctrl-c in Visual mode -:vnoremap :$put ='vmap works' -GV -:vunmap -:" -:" langmap should not get remapped in insert mode -:inoremap { FAIL_ilangmap -:set langmap=+{ langnoremap -o+ -:" Insert-mode expr mapping with langmap -:inoremap { "FAIL_iexplangmap" -o+ -:" langmap should not get remapped in Command-line mode -:cnoremap { FAIL_clangmap -:call append(line('$'), '+') -:cunmap { -:" Command-line mode expr mapping with langmap -:cnoremap { "FAIL_cexplangmap" -:call append(line('$'), '+') -:cunmap { -:" -:" issue #212 (feedkeys insert mapping at current position) -:nnoremap . :call feedkeys(".", "in") -:/^a b -0qqdw.ifooqj0@q:unmap . - -:" U works only within a single line -:imapclear -:imap ( ()U -G2oki -Test1: text with a (here some more textk. -:" test undo -G2oki -Test2: text wit a (here some more text [und undo]uk.u -:" -:imapclear -:set whichwrap=<,>,[,] -G3o2k -:exe ":norm! iTest3: text with a (parenthesis here\U\new line here\\\." - - - -:/^test/,$w! test.out -:qa! -ENDTEST - -test starts here: - -a b c d -a b c d - diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok deleted file mode 100644 index b493cff2b1..0000000000 --- a/src/testdir/test_mapping.ok +++ /dev/null @@ -1,22 +0,0 @@ -test starts here: - -fooc d -fooc d -vim -TEST2: CTRL-C |A| - -vmap works -+ -+ -+ -+ - -Test1: text with a (here some more text) -Test1: text with a (here some more text) - - -Test2: text wit a (here some more text [und undo]) - -new line here -Test3: text with a (parenthesis here -new line here diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim new file mode 100644 index 0000000000..a1281eb4d3 --- /dev/null +++ b/src/testdir/test_mapping.vim @@ -0,0 +1,108 @@ +" Tests for mappings and abbreviations + +if !has('multi_byte') + finish +endif + +func Test_abbreviation() + " abbreviation with 0x80 should work + inoreab чкпр vim + call feedkeys("Goчкпр \", "xt") + call assert_equal('vim ', getline('$')) + iunab чкпр + set nomodified +endfunc + +func Test_map_ctrl_c_insert() + " mapping of ctrl-c in Insert mode + set cpo-=< cpo-=k + inoremap + cnoremap dummy + cunmap + call feedkeys("GoTEST2: CTRL-C |\A|\", "xt") + call assert_equal('TEST2: CTRL-C |A|', getline('$')) + unmap! + set nomodified +endfunc + +func Test_map_ctrl_c_visual() + " mapping of ctrl-c in Visual mode + vnoremap :$put ='vmap works' + call feedkeys("GV\\", "xt") + call assert_equal('vmap works', getline('$')) + vunmap + set nomodified +endfunc + +func Test_map_langmap() + " langmap should not get remapped in insert mode + inoremap { FAIL_ilangmap + set langmap=+{ langnoremap + call feedkeys("Go+\", "xt") + call assert_equal('+', getline('$')) + + " Insert-mode expr mapping with langmap + inoremap { "FAIL_iexplangmap" + call feedkeys("Go+\", "xt") + call assert_equal('+', getline('$')) + iunmap { + + " langmap should not get remapped in Command-line mode + cnoremap { FAIL_clangmap + call feedkeys(":call append(line('$'), '+')\", "xt") + call assert_equal('+', getline('$')) + cunmap { + + " Command-line mode expr mapping with langmap + cnoremap { "FAIL_cexplangmap" + call feedkeys(":call append(line('$'), '+')\", "xt") + call assert_equal('+', getline('$')) + cunmap { + set nomodified +endfunc + +func Test_map_feedkeys() + " issue #212 (feedkeys insert mapping at current position) + nnoremap . :call feedkeys(".", "in") + call setline('$', ['a b c d', 'a b c d']) + $-1 + call feedkeys("0qqdw.ifoo\qj0@q\", "xt") + call assert_equal(['fooc d', 'fooc d'], getline(line('$') - 1, line('$'))) + unmap . + set nomodified +endfunc + +func Test_map_cursor() + " U works only within a single line + imapclear + imap ( ()U + call feedkeys("G2o\ki\Test1: text with a (here some more text\k.", "xt") + call assert_equal('Test1: text with a (here some more text)', getline(line('$') - 2)) + call assert_equal('Test1: text with a (here some more text)', getline(line('$') - 1)) + + " test undo + call feedkeys("G2o\ki\Test2: text wit a (here some more text [und undo]\u\k.u", "xt") + call assert_equal('', getline(line('$') - 2)) + call assert_equal('Test2: text wit a (here some more text [und undo])', getline(line('$') - 1)) + set nomodified + imapclear +endfunc + +" This isn't actually testing a mapping, but similar use of CTRL-G U as above. +func Test_break_undo() + :set whichwrap=<,>,[,] + call feedkeys("G4o2k", "xt") + exe ":norm! iTest3: text with a (parenthesis here\U\new line here\\\." + call assert_equal('new line here', getline(line('$') - 3)) + call assert_equal('Test3: text with a (parenthesis here', getline(line('$') - 2)) + call assert_equal('new line here', getline(line('$') - 1)) + set nomodified +endfunc + +func Test_map_meta_quotes() + imap foo + call feedkeys("Go-\-\", "xt") + call assert_equal("-foo-", getline('$')) + set nomodified + iunmap +endfunc diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 57dde19bab..67f3ea7373 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -1,7 +1,7 @@ " Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(), " matchaddpos(), matcharg(), matchdelete(), matchstrpos() and setmatches(). -function Test_matcharg() +function Test_match() highlight MyGroup1 term=bold ctermbg=red guibg=red highlight MyGroup2 term=italic ctermbg=green guibg=green highlight MyGroup3 term=underline ctermbg=blue guibg=blue @@ -162,4 +162,28 @@ func Test_matchstrpos() call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img')) endfunc +func Test_matchaddpos() + syntax on + set hlsearch + + call setline(1, ['12345', 'NP']) + call matchaddpos('Error', [[1,2], [1,6], [2,2]]) + redraw! + call assert_notequal(screenattr(2,2), 0) + call assert_equal(screenattr(2,2), screenattr(1,2)) + call assert_notequal(screenattr(2,2), screenattr(1,6)) + 1 + call matchadd('Search', 'N\|\n') + redraw! + call assert_notequal(screenattr(2,1), 0) + call assert_equal(screenattr(2,1), screenattr(1,6)) + exec "norm! i0\" + redraw! + call assert_equal(screenattr(2,2), screenattr(1,6)) + + nohl + syntax off + set hlsearch& +endfunc + " vim: et ts=2 sw=2 diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index cceb180189..21dd7fe4f8 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -16,7 +16,7 @@ function! Test_whichwrap() set whichwrap& endfunction -function! Test_options() +function Test_options() let caught = 'ok' try options @@ -29,7 +29,7 @@ function! Test_options() close endfunction -function! Test_path_keep_commas() +function Test_path_keep_commas() " Test that changing 'path' keeps two commas. set path=foo,,bar set path-=bar @@ -38,3 +38,13 @@ function! Test_path_keep_commas() set path& endfunction + +func Test_signcolumn() + if has('signs') + call assert_equal("auto", &signcolumn) + set signcolumn=yes + set signcolumn=no + call assert_fails('set signcolumn=nope') + endif +endfunc + diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 9f0b5106e9..b7d985d0df 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1505,3 +1505,42 @@ func Test_duplicate_buf() call delete('Xgrepthis') endfunc + +" Quickfix/Location list set/get properties tests +function Xproperty_tests(cchar) + call s:setup_commands(a:cchar) + + " Error cases + call assert_fails('call g:Xgetlist(99)', 'E715:') + call assert_fails('call g:Xsetlist(99)', 'E714:') + call assert_fails('call g:Xsetlist([], "a", [])', 'E715:') + + " Set and get the title + Xopen + wincmd p + call g:Xsetlist([{'filename':'foo', 'lnum':27}]) + call g:Xsetlist([], 'a', {'title' : 'Sample'}) + let d = g:Xgetlist({"title":1}) + call assert_equal('Sample', d.title) + + Xopen + call assert_equal('Sample', w:quickfix_title) + Xclose + + " Invalid arguments + call assert_fails('call g:Xgetlist([])', 'E715') + call assert_fails('call g:Xsetlist([], "a", [])', 'E715') + let s = g:Xsetlist([], 'a', {'abc':1}) + call assert_equal(-1, s) + + call assert_equal({}, g:Xgetlist({'abc':1})) + + if a:cchar == 'l' + call assert_equal({}, getloclist(99, ['title'])) + endif +endfunction + +function Test_qf_property() + call Xproperty_tests('c') + call Xproperty_tests('l') +endfunction diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim index 8528412806..ea3b2e7392 100644 --- a/src/testdir/test_regexp_latin.vim +++ b/src/testdir/test_regexp_latin.vim @@ -30,3 +30,12 @@ func Test_equivalence_re2() set re=2 call s:equivalence_test() endfunc + +func Test_recursive_substitute() + new + s/^/\=execute("s#^##gn") + " check we are now not in the sandbox + call setwinvar(1, 'myvar', 1) + bwipe! +endfunc + diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim index 81d8f5b04a..ea91829162 100644 --- a/src/testdir/test_regexp_utf8.vim +++ b/src/testdir/test_regexp_utf8.vim @@ -25,11 +25,13 @@ endfunc func Test_equivalence_re1() set re=1 call s:equivalence_test() + set re=0 endfunc func Test_equivalence_re2() set re=2 call s:equivalence_test() + set re=0 endfunc func s:classes_test() @@ -82,9 +84,26 @@ endfunc func Test_classes_re1() set re=1 call s:classes_test() + set re=0 endfunc func Test_classes_re2() set re=2 call s:classes_test() + set re=0 +endfunc + +func Test_source_utf8() + " check that sourcing a script with 0x80 as second byte works + new + call setline(1, [':%s/àx/--à1234--/g', ':%s/Àx/--À1234--/g']) + write! Xscript + bwipe! + new + call setline(1, [' àx ', ' Àx ']) + source! Xscript | echo + call assert_equal(' --à1234-- ', getline(1)) + call assert_equal(' --À1234-- ', getline(2)) + bwipe! + call delete('Xscript') endfunc diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim index 4c4935b92e..cbe481c594 100644 --- a/src/testdir/test_viminfo.vim +++ b/src/testdir/test_viminfo.vim @@ -425,3 +425,33 @@ func Test_viminfo_file_marks() call delete('Xviminfo') endfunc + +func Test_viminfo_file_mark_tabclose() + tabnew Xtestfileintab + call setline(1, ['a','b','c','d','e']) + 4 + q! + wviminfo Xviminfo + sp Xviminfo + /^> .*Xtestfileintab + let lnum = line('.') + while 1 + if lnum == line('$') + call assert_false(1, 'mark not found in Xtestfileintab') + break + endif + let lnum += 1 + let line = getline(lnum) + if line == '' + call assert_false(1, 'mark not found in Xtestfileintab') + break + endif + if line =~ "^\t\"" + call assert_equal('4', substitute(line, ".*\"\t\\(\\d\\).*", '\1', '')) + break + endif + endwhile + + call delete('Xviminfo') + silent! bwipe Xtestfileintab +endfunc diff --git a/src/version.c b/src/version.c index 02b60b04fc..92472e9e23 100644 --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,19 @@ static char *(features[]) = #else "-xim", #endif +#ifdef WIN3264 +# ifdef FEAT_XPM_W32 + "+xpm_w32", +# else + "-xpm_w32", +# endif +#else +# ifdef HAVE_XPM + "+xpm", +# else + "-xpm", +# endif +#endif #if defined(UNIX) || defined(VMS) # ifdef USE_XSMP_INTERACT "+xsmp_interact", @@ -759,25 +772,60 @@ static char *(features[]) = "+xterm_save", #else "-xterm_save", -#endif -#ifdef WIN3264 -# ifdef FEAT_XPM_W32 - "+xpm_w32", -# else - "-xpm_w32", -# endif -#else -# ifdef HAVE_XPM - "+xpm", -# else - "-xpm", -# endif #endif NULL }; static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2222, +/**/ + 2221, +/**/ + 2220, +/**/ + 2219, +/**/ + 2218, +/**/ + 2217, +/**/ + 2216, +/**/ + 2215, +/**/ + 2214, +/**/ + 2213, +/**/ + 2212, +/**/ + 2211, +/**/ + 2210, +/**/ + 2209, +/**/ + 2208, +/**/ + 2207, +/**/ + 2206, +/**/ + 2205, +/**/ + 2204, +/**/ + 2203, +/**/ + 2202, +/**/ + 2201, +/**/ + 2200, +/**/ + 2199, /**/ 2198, /**/ diff --git a/src/vim.h b/src/vim.h index 0928108df5..e68463bb8d 100644 --- a/src/vim.h +++ b/src/vim.h @@ -1366,7 +1366,8 @@ typedef enum { HLF_8 = 0 /* Meta & special keys listed with ":map", text that is displayed different from what it is */ - , HLF_AT /* @ and ~ characters at end of screen, characters that + , HLF_EOB /* after the last line in the buffer */ + , HLF_AT /* @ characters at end of screen, characters that don't really exist in the text */ , HLF_D /* directories in CTRL-D listing */ , HLF_E /* error messages */ @@ -1413,7 +1414,7 @@ typedef enum /* The HL_FLAGS must be in the same order as the HLF_ enums! * When changing this also adjust the default for 'highlight'. */ -#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \ +#define HL_FLAGS {'8', '~', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \ 'n', 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \ 'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \ 'B', 'P', 'R', 'L', \ diff --git a/src/window.c b/src/window.c index b13a1d7e7d..f4ec96494c 100644 --- a/src/window.c +++ b/src/window.c @@ -1363,7 +1363,7 @@ win_init_some(win_T *newp, win_T *oldp) #if defined(FEAT_WINDOWS) || defined(PROTO) /* - * Check if "win" is a pointer to an existing window. + * Check if "win" is a pointer to an existing window in the current tab page. */ int win_valid(win_T *win) @@ -1378,6 +1378,28 @@ win_valid(win_T *win) return FALSE; } +/* + * Check if "win" is a pointer to an existing window in any tab page. + */ + int +win_valid_any_tab(win_T *win) +{ + win_T *wp; + tabpage_T *tp; + + if (win == NULL) + return FALSE; + FOR_ALL_TABPAGES(tp) + { + FOR_ALL_WINDOWS_IN_TAB(tp, wp) + { + if (wp == win) + return TRUE; + } + } + return FALSE; +} + /* * Return the number of windows. */ @@ -7160,6 +7182,20 @@ win_id2tabwin(typval_T *argvars, list_T *list) list_append_number(list, 0); } + win_T * +win_id2wp(typval_T *argvars) +{ + win_T *wp; + tabpage_T *tp; + int id = get_tv_number(&argvars[0]); + + FOR_ALL_TAB_WINDOWS(tp, wp) + if (wp->w_id == id) + return wp; + + return NULL; +} + int win_id2win(typval_T *argvars) {