1- *builtin.txt* For Vim version 9.0. Last change: 2022 Nov 14
1+ *builtin.txt* For Vim version 9.0. Last change: 2022 Nov 21
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -208,6 +208,7 @@ get({func}, {what}) any get property of funcref/partial {func}
208208getbufinfo([{buf} ]) List information about buffers
209209getbufline({buf} , {lnum} [, {end} ])
210210 List lines {lnum} to {end} of buffer {buf}
211+ getbufoneline({buf} , {lnum} ) String line {lnum} of buffer {buf}
211212getbufvar({buf} , {varname} [, {def} ])
212213 any variable {varname} in buffer {buf}
213214getchangelist([{buf} ]) List list of change list items
@@ -3206,7 +3207,8 @@ getbufinfo([{dict}])
32063207getbufline({buf} , {lnum} [, {end} ])
32073208 Return a | List | with the lines starting from {lnum} to {end}
32083209 (inclusive) in the buffer {buf} . If {end} is omitted, a
3209- | List | with only the line {lnum} is returned.
3210+ | List | with only the line {lnum} is returned. See
3211+ `getbufoneline ()` for only getting the line.
32103212
32113213 For the use of {buf} , see | bufname() | above.
32123214
@@ -3229,6 +3231,11 @@ getbufline({buf}, {lnum} [, {end}])
32293231
32303232< Can also be used as a | method | : >
32313233 GetBufnr()->getbufline(lnum)
3234+ <
3235+ *getbufoneline()*
3236+ getbufoneline({buf} , {lnum} )
3237+ Just like `getbufline ()` but only get one line and return it
3238+ as a string.
32323239
32333240getbufvar({buf} , {varname} [, {def} ]) *getbufvar()*
32343241 The result is the value of option or local buffer variable
@@ -3773,7 +3780,8 @@ getline({lnum} [, {end}])
37733780< Can also be used as a | method | : >
37743781 ComputeLnum()->getline()
37753782
3776- < To get lines from another buffer see | getbufline() |
3783+ < To get lines from another buffer see | getbufline() | and
3784+ | getbufoneline() |
37773785
37783786getloclist({nr} [, {what} ]) *getloclist()*
37793787 Returns a | List | with all the entries in the location list for
@@ -5566,6 +5574,10 @@ map({expr1}, {expr2}) *map()*
55665574 If {expr2} is a | Funcref | it is called with two arguments:
55675575 1. The key or the index of the current item.
55685576 2. the value of the current item.
5577+ With a legacy script lambda you don't get an error if it only
5578+ accepts one argument, but with a Vim9 lambda you get "E1106:
5579+ One argument too many", the number of arguments must match.
5580+
55695581 The function must return the new value of the item. Example
55705582 that changes each value by "key-value": >
55715583 func KeyValue(key, val)
@@ -7932,29 +7944,38 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()*
79327944
79337945 setcellwidths({list} ) *setcellwidths()*
79347946 Specify overrides for cell widths of character ranges. This
7935- tells Vim how wide characters are, counted in screen cells.
7936- This overrides 'ambiwidth' . Example: >
7937- setcellwidths([[0xad, 0xad, 1],
7938- \ [0x2194, 0x2199, 2]])
7939-
7940- < *E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
7941- The {list} argument is a list of lists with each three
7942- numbers. These three numbers are [low, high, width]. "low"
7943- and "high" can be the same, in which case this refers to one
7944- character. Otherwise it is the range of characters from "low"
7945- to "high" (inclusive). "width" is either 1 or 2, indicating
7946- the character width in screen cells.
7947- An error is given if the argument is invalid, also when a
7948- range overlaps with another.
7947+ tells Vim how wide characters are when displayed in the
7948+ terminal, counted in screen cells. The values override
7949+ 'ambiwidth' . Example: >
7950+ call setcellwidths([
7951+ \ [0x111, 0x111, 1],
7952+ \ [0x2194, 0x2199, 2],
7953+ \ ])
7954+
7955+ < The {list} argument is a List of Lists with each three
7956+ numbers: [{low} , {high} , {width} ]. *E1109* *E1110*
7957+ {low} and {high} can be the same, in which case this refers to
7958+ one character. Otherwise it is the range of characters from
7959+ {low} to {high} (inclusive). *E1111* *E1114*
79497960 Only characters with value 0x100 and higher can be used.
79507961
7962+ {width} must be either 1 or 2, indicating the character width
7963+ in screen cells. *E1112*
7964+ An error is given if the argument is invalid, also when a
7965+ range overlaps with another. *E1113*
7966+
79517967 If the new value causes 'fillchars' or 'listchars' to become
79527968 invalid it is rejected and an error is given.
79537969
7954- To clear the overrides pass an empty list: >
7970+ To clear the overrides pass an empty { list} : >
79557971 setcellwidths([]);
7972+
79567973< You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
7957- the effect for known emoji characters.
7974+ the effect for known emoji characters. Move the cursor
7975+ through the text to check if the cell widths of your terminal
7976+ match with what Vim knows about each emoji. If it doesn't
7977+ look right you need to adjust the {list} argument.
7978+
79587979
79597980setcharpos({expr} , {list} ) *setcharpos()*
79607981 Same as | setpos() | but uses the specified column number as the
0 commit comments