aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/provider/clipboard.vim7
-rw-r--r--runtime/doc/builtin.txt50
-rw-r--r--runtime/doc/editing.txt38
-rw-r--r--runtime/doc/lua.txt3
-rw-r--r--runtime/doc/options.txt22
-rw-r--r--runtime/doc/pattern.txt2
-rw-r--r--runtime/doc/repeat.txt2
-rw-r--r--runtime/doc/testing.txt38
-rw-r--r--runtime/doc/usr_41.txt3
-rw-r--r--runtime/lua/man.lua2
10 files changed, 146 insertions, 21 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 991bed6bbd..026c01bce6 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -139,7 +139,12 @@ function! provider#clipboard#Executable() abort
let s:paste['*'] = s:paste['+']
return 'termux-clipboard'
elseif !empty($TMUX) && executable('tmux')
- let s:copy['+'] = ['tmux', 'load-buffer', '-']
+ let [major, minor] = matchlist(systemlist(['tmux', '-V'])[0], 'tmux \(\d\+\)\.\(\d\+\)')[1:2]
+ if major > 3 || (major == 3 && minor >= 2)
+ let s:copy['+'] = ['tmux', 'load-buffer', '-w', '-']
+ else
+ let s:copy['+'] = ['tmux', 'load-buffer', '-']
+ endif
let s:paste['+'] = ['tmux', 'save-buffer', '-']
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 8ffe9d54a4..11352bb0c8 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -134,7 +134,8 @@ exists({expr}) Number |TRUE| if {expr} exists
exp({expr}) Float exponential of {expr}
expand({expr} [, {nosuf} [, {list}]])
any expand special keywords in {expr}
-expandcmd({expr}) String expand {expr} like with `:edit`
+expandcmd({string} [, {options}])
+ String expand {string} like with `:edit`
extend({expr1}, {expr2} [, {expr3}])
List/Dict insert items of {expr2} into {expr1}
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
@@ -466,10 +467,11 @@ str2list({expr} [, {utf8}]) List convert each character of {expr} to
ASCII/UTF-8 value
str2nr({expr} [, {base} [, {quoted}]])
Number convert String to Number
+strcharlen({expr}) Number character length of the String {expr}
strcharpart({str}, {start} [, {len}])
String {len} characters of {str} at
character {start}
-strchars({expr} [, {skipcc}]) Number character length of the String {expr}
+strchars({expr} [, {skipcc}]) Number character count of the String {expr}
strdisplaywidth({expr} [, {col}]) Number display length of the String {expr}
strftime({format} [, {time}]) String format time with a specified format
strgetchar({str}, {index}) Number get char {index} from {str}
@@ -654,9 +656,10 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()*
For the use of {buf}, see |bufname()|.
- {lnum} is used like with |append()|. Note that using |line()|
- would use the current buffer, not the one appending to.
- Use "$" to append at the end of the buffer.
+ {lnum} is the line number to append below. Note that using
+ |line()| would use the current buffer, not the one appending
+ to. Use "$" to append at the end of the buffer. Other string
+ values are not supported.
On success 0 is returned, on failure 1 is returned.
@@ -2042,18 +2045,27 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
Can also be used as a |method|: >
Getpattern()->expand()
-expandcmd({string}) *expandcmd()*
+expandcmd({string} [, {options}]) *expandcmd()*
Expand special items in String {string} like what is done for
an Ex command such as `:edit`. This expands special keywords,
like with |expand()|, and environment variables, anywhere in
{string}. "~user" and "~/path" are only expanded at the
start.
+
+ The following items are supported in the {options} Dict
+ argument:
+ errmsg If set to TRUE, error messages are displayed
+ if an error is encountered during expansion.
+ By default, error messages are not displayed.
+
Returns the expanded string. If an error is encountered
during expansion, the unmodified {string} is returned.
+
Example: >
:echo expandcmd('make %<.o')
-< make /path/runtime/doc/builtin.o ~
-
+ make /path/runtime/doc/builtin.o
+ :echo expandcmd('make %<.o', {'errmsg': v:true})
+<
Can also be used as a |method|: >
GetCommand()->expandcmd()
<
@@ -7080,8 +7092,8 @@ setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()*
GetLoclist()->setloclist(winnr)
setmatches({list} [, {win}]) *setmatches()*
- Restores a list of matches saved by |getmatches() for the
- current window|. Returns 0 if successful, otherwise -1. All
+ Restores a list of matches saved by |getmatches()| for the
+ current window. Returns 0 if successful, otherwise -1. All
current matches are cleared before the list is restored. See
example for |getmatches()|.
If {win} is specified, use the window with this number or
@@ -7261,6 +7273,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
*setreg()*
setreg({regname}, {value} [, {options}])
Set the register {regname} to {value}.
+ If {regname} is "" or "@", the unnamed register '"' is used.
The {regname} argument is a string.
{value} may be any value returned by |getreg()| or
@@ -7834,6 +7847,21 @@ str2nr({string} [, {base}]) *str2nr()*
Can also be used as a |method|: >
GetText()->str2nr()
+
+strcharlen({string}) *strcharlen()*
+ The result is a Number, which is the number of characters
+ in String {string}. Composing characters are ignored.
+ |strchars()| can count the number of characters, counting
+ composing characters separately.
+
+ Returns 0 if {string} is empty or on error.
+
+ Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
+
+ Can also be used as a |method|: >
+ GetText()->strcharlen()
+
+
strcharpart({src}, {start} [, {len}]) *strcharpart()*
Like |strpart()| but using character index and length instead
of byte index and length. Composing characters are counted
@@ -7848,12 +7876,14 @@ strcharpart({src}, {start} [, {len}]) *strcharpart()*
Can also be used as a |method|: >
GetText()->strcharpart(5)
+
strchars({string} [, {skipcc}]) *strchars()*
The result is a Number, which is the number of characters
in String {string}.
When {skipcc} is omitted or zero, composing characters are
counted separately.
When {skipcc} set to 1, Composing characters are ignored.
+ |strcharlen()| always does this.
Returns zero on error.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 21a30ca429..58a5cbc60c 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -545,6 +545,44 @@ Before editing binary, executable or Vim script files you should set the
option. This will avoid the use of 'fileformat'. Without this you risk that
single <NL> characters are unexpectedly replaced with <CR><NL>.
+END OF LINE AND END OF FILE *eol-and-eof*
+
+Vim has several options to control the file format:
+ 'fileformat' the <EOL> style: Unix, DOS, Mac
+ 'endofline' whether the last line ends with a <EOL>
+ 'endoffile' whether the file ends with a CTRL-Z
+ 'fixendofline' whether to fix eol and eof
+
+The first three values are normally detected automatically when reading the
+file and are used when writing the text to a file. While editing the buffer
+it looks like every line has a line ending and the CTRL-Z isn't there (an
+exception is when 'binary' is set, it works differently then).
+
+The 'fixendofline' option can be used to choose what to write. You can also
+change the option values to write the file differently than how it was read.
+
+Here are some examples how to use them.
+
+If you want files in Unix format (every line NL terminated): >
+ setl ff=unix fixeol
+You should probably do this on any Unix-like system. Also modern MS-Windows
+systems tend to work well with this. It is recommended to always use this
+format for Vim scripts.
+
+If you want to use an old MS-DOS file in a modern environment, fixing line
+endings and dropping CTRL-Z, but keeping the <CR><NL> style <EOL>: >
+ setl ff=dos fixeol
+This is useful for many MS-Windows programs, they regularly expect the
+<CR><NL> line endings.
+
+If you want to drop the final <EOL> and add a final CTRL-Z (e.g. for an old
+system like CP/M): >
+ setl ff=dos nofixeol noeol eof
+
+If you want to preserve the fileformat exactly as-is, including any final
+<EOL> and final CTRL-Z: >
+ setl nofixeol
+
==============================================================================
3. The argument list *argument-list* *arglist*
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 70a28a7519..c4e139bca7 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -677,6 +677,9 @@ vim.diff({a}, {b}, {opts}) *vim.diff()*
• "unified": (default) String in unified format.
• "indices": Array of hunk locations.
Note: This option is ignored if `on_hunk` is used.
+ • `linematch` (boolean): Run linematch on the resulting hunks
+ from xdiff. Requires `result_type = indices`, ignored
+ otherwise.
• `algorithm` (string):
Diff algorithm to use. Values:
• "myers" the default algorithm
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 4718876b29..818c6d0115 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1053,19 +1053,26 @@ A jump table for the options with a short description can be found at |Q_op|.
text should normally be narrower. This prevents
text indented almost to the right window border
occupying lot of vertical space when broken.
+ (default: 20)
shift:{n} After applying 'breakindent', the wrapped line's
beginning will be shifted by the given number of
characters. It permits dynamic French paragraph
indentation (negative) or emphasizing the line
continuation (positive).
+ (default: 0)
sbr Display the 'showbreak' value before applying the
additional indent.
+ (default: off)
list:{n} Adds an additional indent for lines that match a
numbered or bulleted list (using the
'formatlistpat' setting).
list:-1 Uses the length of a match with 'formatlistpat'
for indentation.
- The default value for min is 20, shift and list is 0.
+ (default: 0)
+ column:{n} Indent at column {n}. Will overrule the other
+ sub-options. Note: an additional indent may be
+ added for the 'showbreak' setting.
+ (default: off)
*'browsedir'* *'bsdir'*
'browsedir' 'bsdir' string (default: "last")
@@ -2017,6 +2024,16 @@ A jump table for the options with a short description can be found at |Q_op|.
Use the indent heuristic for the internal
diff library.
+ linematch:{n} Enable a second stage diff on each generated
+ hunk in order to align lines. When the total
+ number of lines in a hunk exceeds {n}, the
+ second stage diff will not be performed as
+ very large hunks can cause noticeable lag. A
+ recommended setting is "linematch:60", as this
+ will enable alignment for a 2 buffer diff with
+ hunks of up to 30 lines each, or a 3 buffer
+ diff with hunks of up to 20 lines each.
+
algorithm:{text} Use the specified diff algorithm with the
internal diff engine. Currently supported
algorithms are:
@@ -2143,6 +2160,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When writing a file and this option is off and the 'binary' option
is on, or 'fixeol' option is off, no CTRL-Z will be written at the
end of the file.
+ See |eol-and-eof| for example settings.
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
'endofline' 'eol' boolean (default on)
@@ -2158,6 +2176,7 @@ A jump table for the options with a short description can be found at |Q_op|.
to remember the presence of a <EOL> for the last line in the file, so
that when you write the file the situation from the original file can
be kept. But you can change it if you want to.
+ See |eol-and-eof| for example settings.
*'equalalways'* *'ea'* *'noequalalways'* *'noea'*
'equalalways' 'ea' boolean (default on)
@@ -2504,6 +2523,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When the 'binary' option is set the value of this option doesn't
matter.
See the 'endofline' option.
+ See |eol-and-eof| for example settings.
*'foldclose'* *'fcl'*
'foldclose' 'fcl' string (default "")
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 371a210847..5357aaa3f1 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -372,7 +372,7 @@ Vim includes two regexp engines:
1. An old, backtracking engine that supports everything.
2. A new, NFA engine that works much faster on some patterns, possibly slower
on some patterns.
-
+ *E1281*
Vim will automatically select the right engine for you. However, if you run
into a problem or want to specifically select one engine or the other, you can
prepend one of the following to the pattern:
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 6a1b8b05a7..1bbd20702b 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -689,7 +689,7 @@ found automatically. Your package would have these files:
< pack/foo/start/lib/autoload/foolib.vim >
func foolib#getit()
-This works, because start packages will be searchd for autoload files, when
+This works, because start packages will be searched for autoload files, when
sourcing the plugins.
==============================================================================
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index f4375c3363..56e0dad656 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -98,18 +98,46 @@ assert_exception({error} [, {msg}]) *assert_exception()*
catch
call assert_exception('E492:')
endtry
-
-assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()*
+<
+ *assert_fails()*
+assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
Run {cmd} and add an error message to |v:errors| if it does
- NOT produce an error. Also see |assert-return|.
- When {error} is given it must match in |v:errmsg|.
+ NOT produce an error or when {error} is not found in the
+ error message. Also see |assert-return|.
+
+ When {error} is a string it must be found literally in the
+ first reported error. Most often this will be the error code,
+ including the colon, e.g. "E123:". >
+ assert_fails('bad cmd', 'E987:')
+<
+ When {error} is a |List| with one or two strings, these are
+ used as patterns. The first pattern is matched against the
+ first reported error: >
+ assert_fails('cmd', ['E987:.*expected bool'])
+< The second pattern, if present, is matched against the last
+ reported error. To only match the last error use an empty
+ string for the first error: >
+ assert_fails('cmd', ['', 'E987:'])
+<
+ If {msg} is empty then it is not used. Do this to get the
+ default message when passing the {lnum} argument.
+
+ When {lnum} is present and not negative, and the {error}
+ argument is present and matches, then this is compared with
+ the line number at which the error was reported. That can be
+ the line number in a function or in a script.
+
+ When {context} is present it is used as a pattern and matched
+ against the context (script name or function name) where
+ {lnum} is located in.
+
Note that beeping is not considered an error, and some failing
commands only beep. Use |assert_beeps()| for those.
Can also be used as a |method|: >
GetCmd()->assert_fails('E99:')
-assert_false({actual} [, {msg}]) *assert_false()*
+assert_false({actual} [, {msg}]) *assert_false()*
When {actual} is not false an error message is added to
|v:errors|, like with |assert_equal()|.
Also see |assert-return|.
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 8abc5bdf06..067ad6648c 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -619,7 +619,8 @@ String manipulation: *string-functions*
stridx() first index of a short string in a long string
strridx() last index of a short string in a long string
strlen() length of a string in bytes
- strchars() length of a string in characters
+ strcharlen() length of a string in characters
+ strchars() number of characters in a string
strwidth() size of string when displayed
strdisplaywidth() size of string when displayed, deals with tabs
setcellwidths() set character cell width overrides
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
index 6eebee6376..5951884e07 100644
--- a/runtime/lua/man.lua
+++ b/runtime/lua/man.lua
@@ -457,7 +457,7 @@ local function get_page(path, silent)
end
local function put_page(page)
- vim.bo.modified = true
+ vim.bo.modifiable = true
vim.bo.readonly = false
vim.bo.swapfile = false