aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/coverity.yml2
-rw-r--r--README.md10
-rw-r--r--runtime/doc/api.txt117
-rw-r--r--runtime/doc/develop.txt31
-rw-r--r--runtime/doc/editing.txt44
-rw-r--r--runtime/doc/eval.txt14
-rw-r--r--runtime/doc/lsp.txt6
-rw-r--r--runtime/doc/nvim.txt2
-rw-r--r--runtime/doc/options.txt78
-rw-r--r--runtime/doc/provider.txt2
-rw-r--r--runtime/doc/quickfix.txt15
-rw-r--r--runtime/doc/vim_diff.txt29
-rw-r--r--runtime/ftplugin/readline.vim25
-rw-r--r--runtime/lua/vim/_meta.lua2
-rw-r--r--runtime/lua/vim/lsp/semantic_tokens.lua41
-rw-r--r--runtime/syntax/fstab.vim279
-rw-r--r--scripts/gen_help_html.lua11
-rw-r--r--src/nvim/api/autocmd.c92
-rw-r--r--src/nvim/api/extmark.c18
-rw-r--r--src/nvim/api/vim.c2
-rw-r--r--src/nvim/ex_getln.c5
-rw-r--r--src/nvim/linematch.c6
-rw-r--r--src/nvim/regexp_nfa.c23
-rw-r--r--src/nvim/testdir/test_cmdline.vim24
-rw-r--r--src/nvim/testdir/test_quickfix.vim1
-rw-r--r--test/functional/api/autocmd_spec.lua12
-rw-r--r--test/functional/autocmd/cmdline_spec.lua1
-rw-r--r--test/functional/lua/vim_spec.lua16
-rw-r--r--test/functional/plugin/lsp/semantic_tokens_spec.lua54
-rw-r--r--test/functional/ui/linematch_spec.lua26
30 files changed, 618 insertions, 370 deletions
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index ce7822b5c1..87e2cb1453 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -37,7 +37,7 @@ jobs:
--form email=$EMAIL \
--form file=@cov-scan.tgz \
--form version="$(git rev-parse HEAD)" \
- --form description="Weekly GHA scan" \
+ --form description="Daily GHA scan" \
'https://scan.coverity.com/builds?project=neovim%2Fneovim'
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
diff --git a/README.md b/README.md
index 7f06455cfc..227b028c01 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
</h1>
-[Documentation](https://neovim.io/doc/general/) |
+[Documentation](https://neovim.io/doc/) |
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
[Twitter](https://twitter.com/Neovim)
@@ -107,9 +107,9 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
encouraged to make a donation for needy children in Uganda. Please see the
kcc section of the vim docs or visit the ICCF web site, available at these URLs:
- http://iccf-holland.org/
- http://www.vim.org/iccf/
- http://www.iccf.nl/
+ https://iccf-holland.org/
+ https://www.vim.org/iccf/
+ https://www.iccf.nl/
You can also sponsor the development of Vim. Vim sponsors can vote for
features. The money goes to Uganda anyway.
@@ -121,7 +121,7 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
[Debian]: https://packages.debian.org/testing/neovim
-[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
+[Ubuntu]: https://packages.ubuntu.com/search?keywords=neovim
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 00f3473bac..d555cff443 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -468,7 +468,7 @@ Example: create a float with scratch buffer: >vim
<
==============================================================================
-Extended marks *api-extended-marks* *extmarks*
+Extended marks *api-extended-marks* *extmarks* *extmark*
Extended marks (extmarks) represent buffer annotations that track text changes
in the buffer. They can represent cursors, folds, misspelled words, anything
@@ -1129,7 +1129,7 @@ nvim_list_uis() *nvim_list_uis()*
• "width" Requested width of the UI
• "rgb" true if the UI uses RGB colors (false implies |cterm-colors|)
• "ext_..." Requested UI extensions, see |ui-option|
- • "chan" Channel id of remote UI (not present for TUI)
+ • "chan" Channel id of remote UI or 0 for TUI
nvim_list_wins() *nvim_list_wins()*
Gets the current list of window handles.
@@ -2485,7 +2485,7 @@ nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, {col_start},
*nvim_buf_clear_namespace()*
nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end})
- Clears namespaced objects (highlights, extmarks, virtual text) from a
+ Clears |namespace|d objects (highlights, |extmarks|, virtual text) from a
region.
Lines are 0-indexed. |api-indexing| To clear the namespace in the entire
@@ -2499,7 +2499,7 @@ nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end})
clear to end of buffer.
nvim_buf_del_extmark({buffer}, {ns_id}, {id}) *nvim_buf_del_extmark()*
- Removes an extmark.
+ Removes an |extmark|.
Parameters: ~
• {buffer} Buffer handle, or 0 for current buffer
@@ -2511,7 +2511,7 @@ nvim_buf_del_extmark({buffer}, {ns_id}, {id}) *nvim_buf_del_extmark()*
*nvim_buf_get_extmark_by_id()*
nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts})
- Gets the position (0-indexed) of an extmark.
+ Gets the position (0-indexed) of an |extmark|.
Parameters: ~
• {buffer} Buffer handle, or 0 for current buffer
@@ -2525,7 +2525,7 @@ nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts})
*nvim_buf_get_extmarks()*
nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
- Gets extmarks in "traversal order" from a |charwise| region defined by
+ Gets |extmarks| in "traversal order" from a |charwise| region defined by
buffer positions (inclusive, 0-indexed |api-indexing|).
Region can be given as (row,col) tuples, or valid extmark ids (whose
@@ -2570,7 +2570,7 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
*nvim_buf_set_extmark()*
nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
- Creates or updates an extmark.
+ Creates or updates an |extmark|.
By default a new extmark is created when no id is passed in, but it is
also possible to create a new mark by passing in a previously unused id or
@@ -2699,19 +2699,19 @@ nvim_create_namespace({name}) *nvim_create_namespace()*
Namespace id
nvim_get_namespaces() *nvim_get_namespaces()*
- Gets existing, non-anonymous namespaces.
+ Gets existing, non-anonymous |namespace|s.
Return: ~
dict that maps from names to namespace ids.
*nvim_set_decoration_provider()*
nvim_set_decoration_provider({ns_id}, {*opts})
- Set or change decoration provider for a namespace
+ Set or change decoration provider for a |namespace|
This is a very general purpose interface for having lua callbacks being
triggered during the redraw code.
- The expected usage is to set extmarks for the currently redrawn buffer.
+ The expected usage is to set |extmarks| for the currently redrawn buffer.
|nvim_buf_set_extmark()| can be called to add marks on a per-window or
per-lines basis. Use the `ephemeral` key to only use the mark for the
current screen redraw (the callback will be called again for the next
@@ -3228,89 +3228,54 @@ nvim_create_augroup({name}, {*opts}) *nvim_create_augroup()*
|autocmd-groups|
nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
- Create an |autocommand|
-
- The API allows for two (mutually exclusive) types of actions to be
- executed when the autocommand triggers: a callback function (Lua or
- Vimscript), or a command (like regular autocommands).
-
- Example using callback: >lua
- -- Lua function
- local myluafun = function() print("This buffer enters") end
-
- -- Vimscript function name (as a string)
- local myvimfun = "g:MyVimFunction"
+ Creates an |autocommand| event handler, defined by `callback` (Lua function or Vimscript function name string) or `command` (Ex command string).
+ Example using Lua callback: >lua
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.c", "*.h"},
- callback = myluafun, -- Or myvimfun
+ callback = function(ev)
+ print(string.format('event fired: s', vim.inspect(ev)))
+ end
})
<
- Lua functions receive a table with information about the autocmd event as
- an argument. To use a function which itself accepts another (optional)
- parameter, wrap the function in a lambda: >lua
- -- Lua function with an optional parameter.
- -- The autocmd callback would pass a table as argument but this
- -- function expects number|nil
- local myluafun = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() end
-
- vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
- pattern = {"*.c", "*.h"},
- callback = function() myluafun() end,
- })
-<
-
- Example using command: >lua
+ Example using an Ex command as the handler: >lua
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.c", "*.h"},
command = "echo 'Entering a C or C++ file'",
})
<
- Example values for pattern: >lua
- pattern = "*.py"
- pattern = { "*.py", "*.pyi" }
-<
-
- Note: The `pattern` is passed to callbacks and commands as a literal string; environment
- variables like `$HOME` and `~` are not automatically expanded as they are by |:autocmd|. Instead,
- |expand()| such variables explicitly: >lua
+ Note: `pattern` is NOT automatically expanded (unlike with |:autocmd|), thus names like
+ "$HOME" and "~" must be expanded explicitly: >lua
pattern = vim.fn.expand("~") .. "/some/path/*.py"
<
- Example values for event: >lua
- event = "BufWritePre"
- event = {"CursorHold", "BufWritePre", "BufWritePost"}
-<
-
Parameters: ~
- • {event} (string|array) The event or events to register this
- autocommand
- • {opts} Dictionary of autocommand options:
- • group (string|integer) optional: the autocommand group name
- or id to match against.
- • pattern (string|array) optional: pattern or patterns to
- match literally against |autocmd-pattern|.
- • buffer (integer) optional: buffer number for buffer local
+ • {event} (string|array) Event(s) that will trigger the handler
+ (`callback` or `command`).
+ • {opts} Options dict:
+ • group (string|integer) optional: autocommand group name or
+ id to match against.
+ • pattern (string|array) optional: pattern(s) to match
+ literally |autocmd-pattern|.
+ • buffer (integer) optional: buffer number for buffer-local
autocommands |autocmd-buflocal|. Cannot be used with
{pattern}.
- • desc (string) optional: description of the autocommand.
- • callback (function|string) optional: if a string, the name
- of a Vimscript function to call when this autocommand is
- triggered. Otherwise, a Lua function which is called when
- this autocommand is triggered. Cannot be used with
- {command}. Lua callbacks can return true to delete the
- autocommand; in addition, they accept a single table
- argument with the following keys:
- • id: (number) the autocommand id
- • event: (string) the name of the event that triggered the
- autocommand |autocmd-events|
- • group: (number|nil) the autocommand group id, if it
- exists
- • match: (string) the expanded value of |<amatch>|
- • buf: (number) the expanded value of |<abuf>|
- • file: (string) the expanded value of |<afile>|
+ • desc (string) optional: description (for documentation and
+ troubleshooting).
+ • callback (function|string) optional: Lua function (or
+ Vimscript function name, if string) called when the
+ event(s) is triggered. Lua callback can return true to
+ delete the autocommand, and receives a table argument with
+ these keys:
+ • id: (number) autocommand id
+ • event: (string) name of the triggered event
+ |autocmd-events|
+ • group: (number|nil) autocommand group id, if any
+ • match: (string) expanded value of |<amatch>|
+ • buf: (number) expanded value of |<abuf>|
+ • file: (string) expanded value of |<afile>|
• data: (any) arbitrary data passed to
|nvim_exec_autocmds()|
@@ -3322,7 +3287,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
autocommands |autocmd-nested|.
Return: ~
- Integer id of the created autocommand.
+ Autocommand id (number)
See also: ~
|autocommand|
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index 9336321d73..ff48ae3e26 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -28,11 +28,9 @@ The Neo bits of Nvim should make it a better Vim, without becoming a
completely different editor.
- In matters of taste, prefer Vim/Unix tradition. If there is no relevant
Vim/Unix tradition, consider the "common case".
-- A feature that people do not know about is a useless feature. Don't add
- obscure features, or at least add hints in documentation that they exist.
-- There is no limit to the features that can be added. Selecting new features
- is based on (1) what users ask for, (2) how much effort it takes to
- implement and (3) someone actually implementing it.
+- There is no limit to the features that can be added. Select new features
+ based on (1) what users ask for, (2) how much effort it takes to implement
+ and (3) someone actually implementing it.
- Backwards compatibility is a feature. The RPC API in particular should
never break.
@@ -48,7 +46,7 @@ NVIM IS... WELL DOCUMENTED *design-documented*
NVIM IS... FAST AND SMALL *design-speed-size*
-Keep Nvim small and fast.
+Keep Nvim small and fast. This directly affects versatility and usability.
- Computers are becoming faster and bigger each year. Vim can grow too, but
no faster than computers are growing. Keep Vim usable on older systems.
- Many users start Vim from a shell very often. Startup time must be short.
@@ -57,7 +55,8 @@ Keep Nvim small and fast.
- Don't forget that some people use Vim over a slow connection. Minimize the
communication overhead.
- Vim is a component among other components. Don't turn it into a massive
- application, but have it work well together with other programs.
+ application, but have it work well together with other programs
+ ("composability").
NVIM IS... MAINTAINABLE *design-maintain*
@@ -250,13 +249,25 @@ vim.paste in runtime/lua/vim/_editor.lua like this: >
LUA *dev-lua*
- Keep the core Lua modules |lua-stdlib| simple. Avoid elaborate OOP or
- pseudo-OOP designs. Plugin authors just want functions to call, they don't
- want to learn a big, fancy inheritance hierarchy. Thus avoid specialized
- objects; tables or values are usually better.
+ pseudo-OOP designs. Plugin authors just want functions to call, not a big,
+ fancy inheritance hierarchy.
+- Avoid requiring or returning special objects in the Nvim stdlib. Plain
+ tables or values are easier to serialize, easier to construct from literals,
+ easier to inspect and print, and inherently compatible with all Lua plugins.
+ (This guideline doesn't apply to opaque, non-data objects like `vim.cmd`.)
API *dev-api*
+- Avoid "mutually exclusive" parameters--via constraints or limitations, if
+ necessary. For example nvim_create_autocmd() has mutually exclusive
+ "callback" and "command" args; but the "command" arg could be eliminated by
+ simply not supporting Vimscript function names, and treating a string
+ "callback" arg as an Ex command (which can call Vimscript functions). The
+ "buffer" arg could also be eliminated by treating a number "pattern" as
+ a buffer number.
+
+ *dev-api-naming*
Use this format to name new RPC |API| functions:
nvim_{thing}_{action}_{arbitrary-qualifiers}
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 3cfc3429de..13b953ed60 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -423,9 +423,8 @@ Note that such expressions are only supported in places where a filename is
expected as an argument to an Ex-command.
*++opt* *[++opt]*
-The [++opt] argument can be used to force the value of 'fileformat',
-'fileencoding' or 'binary' to a value for one command, and to specify the
-behavior for bad characters. The form is: >
+The [++opt] argument can be used to set some options for one command, and to
+specify the behavior for bad characters. The form is: >
++{optname}
Or: >
++{optname}={value}
@@ -436,13 +435,11 @@ Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin* *++edit*
bin or binary sets 'binary'
nobin or nobinary resets 'binary'
bad specifies behavior for bad characters
- edit for |:read| only: keep option values as if editing
- a file
- p creates the parent directory (or directories) of
- a filename if they do not exist
+ edit for |:read|: keeps options as if editing a file
+ p for |:write|: creates the file's parent directory
-{value} cannot contain white space. It can be any valid value for these
-options. Examples: >
+{value} cannot contain whitespace. It can be any valid value for the options.
+Examples: >
:e ++ff=unix
This edits the same file again with 'fileformat' set to "unix". >
@@ -452,9 +449,24 @@ This writes the current buffer to "newfile" in latin1 format.
The message given when writing a file will show "[converted]" when
'fileencoding' or the value specified with ++enc differs from 'encoding'.
-There may be several ++opt arguments, separated by white space. They must all
+There may be several ++opt arguments, separated by whitespace. They must all
appear before any |+cmd| argument.
+ *++p*
+The "++p" flag creates the parent directory of the file if it does not exist.
+For example if you edit "foo/bar/file.txt", the ":write ++p" command creates
+"foo/bar/" if necessary before writing the file. >
+
+ :edit foo/bar/file.txt
+ :write ++p
+
+If you want :write (without "++p") to always create missing parent
+directories, add this autocmd to your config: >
+
+ " Auto-create parent directories (except for URIs "://").
+ au BufWritePre,FileWritePre * if @% !~# '\(://\)' | call mkdir(expand('<afile>:p:h'), 'p') | endif
+<
+
*++bad*
The argument of "++bad=" specifies what happens with characters that can't be
converted and illegal bytes. It can be one of three things:
@@ -895,11 +907,13 @@ Note: When the 'write' option is off, you are not able to write any file.
*E502* *E503* *E504* *E505*
*E512* *E514* *E667* *E949*
:w[rite] [++opt] Write the whole buffer to the current file. This is
- the normal way to save changes to a file. It fails
- when the 'readonly' option is set or when there is
- another reason why the file can't be written.
- For ++opt see |++opt|, but only ++bin, ++nobin, ++ff
- and ++enc are effective.
+ the normal way to save changes to a file. Fails when
+ 'readonly' is set or when there is another reason why
+ the file can't be written, such as when the parent
+ directory doesn't exist (use |++p| to avoid that).
+ For ++opt see |++opt|, but only ++p, ++bin, ++nobin,
+ ++ff and ++enc are effective.
+
:w[rite]! [++opt] Like ":write", but forcefully write when 'readonly' is
set or there is another reason why writing was
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index c989b67b96..61d540a3dd 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1708,13 +1708,13 @@ v:charconvert_to
*v:cmdarg* *cmdarg-variable*
v:cmdarg This variable is used for two purposes:
- 1. The extra arguments given to a file read/write command.
- Currently these are "++enc=" and "++ff=". This variable is
- 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
- included here, because it will be executed anyway.
+ 1. The extra arguments ("++p", "++enc=", "++ff=") given to
+ a file read/write command. This is 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: "+cmd" 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
in 'printexpr'.
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 37a0a8c076..75d5c067b1 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -325,7 +325,7 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method
},
}
<
- or if using 'nvim-lspconfig', you can use the {handlers} key of `setup()`:
+ or if using "nvim-lspconfig", you can use the {handlers} key of `setup()`:
>lua
require('lspconfig').rust_analyzer.setup {
@@ -1340,9 +1340,7 @@ start({bufnr}, {client_id}, {opts}) *vim.lsp.semantic_tokens.start()*
|vim.lsp.buf_attach_client()|. To opt-out of semantic highlighting with a
server that supports it, you can delete the semanticTokensProvider table
from the {server_capabilities} of your client in your |LspAttach| callback
- or your configuration's `on_attach` callback.
-
- >lua
+ or your configuration's `on_attach` callback: >lua
client.server_capabilities.semanticTokensProvider = nil
<
diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt
index 4946779a7c..ef407922da 100644
--- a/runtime/doc/nvim.txt
+++ b/runtime/doc/nvim.txt
@@ -24,8 +24,8 @@ Transitioning from Vim *nvim-from-vim*
1. To start the transition, create your |init.vim| (user config) file: >vim
- :call mkdir(stdpath('config'), 'p')
:exe 'edit '.stdpath('config').'/init.vim'
+ :write ++p
2. Add these contents to the file: >vim
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 2e5381e5fe..b6eb7c57e8 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5563,44 +5563,48 @@ A jump table for the options with a short description can be found at |Q_op|.
messages, for example with CTRL-G, and to avoid some other messages.
It is a list of flags:
flag meaning when present ~
- f use "(3 of 5)" instead of "(file 3 of 5)"
- i use "[noeol]" instead of "[Incomplete last line]"
- l use "999L, 888B" instead of "999 lines, 888 bytes"
- m use "[+]" instead of "[Modified]"
- n use "[New]" instead of "[New File]"
- r use "[RO]" instead of "[readonly]"
- w use "[w]" instead of "written" for file write message
+ f use "(3 of 5)" instead of "(file 3 of 5)" *shm-f*
+ i use "[noeol]" instead of "[Incomplete last line]" *shm-i*
+ l use "999L, 888B" instead of "999 lines, 888 bytes" *shm-l*
+ m use "[+]" instead of "[Modified]" *shm-m*
+ n use "[New]" instead of "[New File]" *shm-n*
+ r use "[RO]" instead of "[readonly]" *shm-r*
+ w use "[w]" instead of "written" for file write message *shm-w*
and "[a]" instead of "appended" for ':w >> file' command
- x use "[dos]" instead of "[dos format]", "[unix]" instead of
- "[unix format]" and "[mac]" instead of "[mac format]".
- a all of the above abbreviations
-
- o overwrite message for writing a file with subsequent message
- for reading a file (useful for ":wn" or when 'autowrite' on)
- O message for reading a file overwrites any previous message.
- Also for quickfix message (e.g., ":cn").
- s don't give "search hit BOTTOM, continuing at TOP" or "search
- hit TOP, continuing at BOTTOM" messages; when using the search
- count do not show "W" after the count message (see S below)
- t truncate file message at the start if it is too long to fit
- on the command-line, "<" will appear in the left most column.
- Ignored in Ex mode.
- T truncate other messages in the middle if they are too long to
- fit on the command line. "..." will appear in the middle.
- Ignored in Ex mode.
- W don't give "written" or "[w]" when writing a file
- A don't give the "ATTENTION" message when an existing swap file
- is found.
- I don't give the intro message when starting Vim |:intro|.
- c don't give |ins-completion-menu| messages. For example,
- "-- XXX completion (YYY)", "match 1 of 2", "The only match",
- "Pattern not found", "Back at original", etc.
- C don't give messages while scanning for ins-completion items,
- for instance "scanning tags"
- q use "recording" instead of "recording @a"
- F don't give the file info when editing a file, like `:silent`
- was used for the command
- S do not show search count message when searching, e.g.
+ x use "[dos]" instead of "[dos format]", "[unix]" *shm-x*
+ instead of "[unix format]" and "[mac]" instead of "[mac
+ format]".
+ a all of the above abbreviations *shm-a*
+
+ o overwrite message for writing a file with subsequent *shm-o*
+ message for reading a file (useful for ":wn" or when
+ 'autowrite' on)
+ O message for reading a file overwrites any previous *smh-O*
+ message. Also for quickfix message (e.g., ":cn").
+ s don't give "search hit BOTTOM, continuing at TOP" or *shm-s*
+ "search hit TOP, continuing at BOTTOM" messages; when using
+ the search count do not show "W" after the count message (see
+ S below)
+ t truncate file message at the start if it is too long *shm-t*
+ to fit on the command-line, "<" will appear in the left most
+ column. Ignored in Ex mode.
+ T truncate other messages in the middle if they are too *shm-T*
+ long to fit on the command line. "..." will appear in the
+ middle. Ignored in Ex mode.
+ W don't give "written" or "[w]" when writing a file *shm-W*
+ A don't give the "ATTENTION" message when an existing *shm-A*
+ swap file is found.
+ I don't give the intro message when starting Vim, *shm-I*
+ see |:intro|.
+ c don't give |ins-completion-menu| messages. For *shm-c*
+ example, "-- XXX completion (YYY)", "match 1 of 2", "The only
+ match", "Pattern not found", "Back at original", etc.
+ C don't give messages while scanning for ins-completion *shm-C*
+ items, for instance "scanning tags"
+ q use "recording" instead of "recording @a" *shm-q*
+ F don't give the file info when editing a file, like *shm-F*
+ `:silent` was used for the command
+ S do not show search count message when searching, e.g. *shm-S*
"[1/5]"
This gives you the opportunity to avoid that a change between buffers
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 8f2feb416b..5375d971f0 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -176,7 +176,7 @@ a |provider| which transparently uses shell commands to communicate with the
system clipboard or any other clipboard "backend".
To ALWAYS use the clipboard for ALL operations (instead of interacting with
-the '+' and/or '*' registers explicitly): >vim
+the "+" and/or "*" registers explicitly): >vim
set clipboard+=unnamedplus
See 'clipboard' for details and options.
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 904d3581bb..e79d79ba1b 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1259,6 +1259,21 @@ not "b:current_compiler". What the command actually does is the following:
For writing a compiler plugin, see |write-compiler-plugin|.
+DOTNET *compiler-dotnet*
+
+The .NET CLI compiler outputs both errors and warnings by default. The output
+may be limited to include only errors, by setting the g:dotnet_errors_only
+variable to |v:true|.
+
+The associated project name is included in each error and warning. To supress
+the project name, set the g:dotnet_show_project_file variable to |v:false|.
+
+Example: limit output to only display errors, and suppress the project name: >
+ let dotnet_errors_only = v:true
+ let dotnet_show_project_file = v:false
+ compiler dotnet
+<
+
GCC *quickfix-gcc* *compiler-gcc*
There's one variable you can set for the GCC compiler:
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 6a2e74eaf5..5c1725a1f8 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -127,7 +127,7 @@ nvim_cmdwin:
==============================================================================
3. New Features *nvim-features*
-MAJOR COMPONENTS ~
+MAJOR COMPONENTS
API |API|
Job control |job-control|
@@ -145,7 +145,7 @@ Terminal emulator |terminal|
Vimscript parser |nvim_parse_expression()|
XDG base directories |xdg|
-USER EXPERIENCE ~
+USER EXPERIENCE
Working intuitively and consistently is a major goal of Nvim.
@@ -176,7 +176,7 @@ Some features are built in that otherwise required external plugins:
- Highlighting the yanked region, see |lua-highlight|.
-ARCHITECTURE ~
+ARCHITECTURE
External plugins run in separate processes. |remote-plugin| This improves
stability and allows those plugins to work without blocking the editor. Even
@@ -187,7 +187,7 @@ Platform and I/O facilities are built upon libuv. Nvim benefits from libuv
features and bug fixes, and other projects benefit from improvements to libuv
by Nvim developers.
-FEATURES ~
+FEATURES
Command-line highlighting:
The expression prompt (|@=|, |c_CTRL-R_=|, |i_CTRL-R_=|) is highlighted
@@ -206,6 +206,7 @@ Commands:
|:match| can be invoked before highlight group is defined
|:source| works with Lua
User commands can support |:command-preview| to show results as you type
+ |:write| with "++p" flag creates parent directories.
Events:
|RecordingEnter|
@@ -226,6 +227,7 @@ Functions:
|stdpath()|
|system()|, |systemlist()| can run {cmd} directly (without 'shell')
|matchadd()| can be called before highlight group is defined
+ |writefile()| with "p" flag creates parent directories.
Highlight groups:
|highlight-blend| controls blend level for a highlight group
@@ -277,7 +279,20 @@ Variables:
|v:windowid| is always available (for use by external UIs)
==============================================================================
-4. Changed features *nvim-features-changed*
+4. Upstreamed features *nvim-upstreamed*
+
+These Nvim features were later integrated into Vim.
+
+- 'fillchars' flags: "eob"
+- 'wildoptions' flags: "pum" enables popupmenu for wildmode completion
+- |<Cmd>|
+- |WinClosed|
+- |WinScrolled|
+- |:sign-define| "numhl" argument
+- |:source| works with anonymous (no file) scripts
+
+==============================================================================
+5. Changed features *nvim-features-changed*
Nvim always builds with all features, in contrast to Vim which may have
certain features removed/added at compile-time. |feature-compile|
@@ -499,7 +514,7 @@ Working directory (Vim implemented some of these later than Nvim):
working directory. Use `getcwd(-1, -1)` to get the global working directory.
==============================================================================
-5. Missing legacy features *nvim-features-missing*
+6. Missing legacy features *nvim-features-missing*
Some legacy Vim features are not yet implemented:
@@ -512,7 +527,7 @@ Some legacy Vim features are not yet implemented:
*:gvim*
==============================================================================
-6. Removed features *nvim-features-removed*
+7. Removed features *nvim-features-removed*
These Vim features were intentionally removed from Nvim.
diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim
index e9ef93ec7f..eba7122347 100644
--- a/runtime/ftplugin/readline.vim
+++ b/runtime/ftplugin/readline.vim
@@ -1,7 +1,8 @@
" Vim filetype plugin file
-" Language: readline(3) configuration file
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2008-07-09
+" Language: readline(3) configuration file
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Last Change: 2022 Dec 09
if exists("b:did_ftplugin")
finish
@@ -11,9 +12,25 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
+setlocal comments=:#
+setlocal commentstring=#\ %s
+setlocal formatoptions-=t formatoptions+=croql
+
let b:undo_ftplugin = "setl com< cms< fo<"
-setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
+if exists("loaded_matchit") && !exists("b:match_words")
+ let b:match_ignorecase = 0
+ let b:match_words = '$if:$else:$endif'
+ let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
+endif
+
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter = "Readline Intialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" ..
+ \ "All Files (*.*)\t*.*\n"
+ let b:undo_ftplugin ..= " | unlet! b:browsefilter"
+endif
let &cpo = s:cpo_save
unlet s:cpo_save
+
+" vim: nowrap sw=2 sts=2 ts=8 noet:
diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua
index 9c7972873e..104f29c4c0 100644
--- a/runtime/lua/vim/_meta.lua
+++ b/runtime/lua/vim/_meta.lua
@@ -526,7 +526,7 @@ local function create_option_accessor(scope)
return setmetatable({}, {
__index = function(_, k)
- return make_option(k, a.nvim_get_option_value(k, { scope = scope }))
+ return make_option(k, a.nvim_get_option_value(k, {}))
end,
__newindex = function(_, k, v)
diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua
index 83b414bf87..b7ffedab2b 100644
--- a/runtime/lua/vim/lsp/semantic_tokens.lua
+++ b/runtime/lua/vim/lsp/semantic_tokens.lua
@@ -55,22 +55,22 @@ end
---@private
---@return string[]
local function modifiers_from_number(x, modifiers_table)
- ---@private
- local function _get_bit(n, k)
- --TODO(jdrouhard): remove once `bit` module is available for non-LuaJIT
+ local modifiers = {}
+ local idx = 1
+ while x > 0 do
if _G.bit then
- return _G.bit.band(_G.bit.rshift(n, k), 1)
+ if _G.bit.band(x, 1) == 1 then
+ modifiers[#modifiers + 1] = modifiers_table[idx]
+ end
+ x = _G.bit.rshift(x, 1)
else
- return math.floor((n / math.pow(2, k)) % 2)
- end
- end
-
- local modifiers = {}
- for i = 0, #modifiers_table - 1 do
- local b = _get_bit(x, i)
- if b == 1 then
- modifiers[#modifiers + 1] = modifiers_table[i + 1]
+ --TODO(jdrouhard): remove this branch once `bit` module is available for non-LuaJIT (#21222)
+ if x % 2 == 1 then
+ modifiers[#modifiers + 1] = modifiers_table[idx]
+ end
+ x = math.floor(x / 2)
end
+ idx = idx + 1
end
return modifiers
@@ -409,7 +409,17 @@ function STHighlighter:on_win(topline, botline)
strict = false,
})
- --TODO(jdrouhard): do something with the modifiers
+ -- TODO(bfredl) use single extmark when hl_group supports table
+ if #token.modifiers > 0 then
+ for _, modifier in pairs(token.modifiers) do
+ api.nvim_buf_set_extmark(self.bufnr, state.namespace, token.line, token.start_col, {
+ hl_group = '@' .. modifier,
+ end_col = token.end_col,
+ priority = vim.highlight.priorities.semantic_tokens,
+ strict = false,
+ })
+ end
+ end
token.extmark_added = true
end
@@ -494,8 +504,7 @@ local M = {}
--- opt-out of semantic highlighting with a server that supports it, you can
--- delete the semanticTokensProvider table from the {server_capabilities} of
--- your client in your |LspAttach| callback or your configuration's
---- `on_attach` callback.
----
+--- `on_attach` callback:
--- <pre>lua
--- client.server_capabilities.semanticTokensProvider = nil
--- </pre>
diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim
index 318488713b..6a3c375b94 100644
--- a/runtime/syntax/fstab.vim
+++ b/runtime/syntax/fstab.vim
@@ -2,8 +2,8 @@
" Language: fstab file
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
" URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim
-" Last Change: 2020 Dec 30
-" Version: 1.4
+" Last Change: 2022 Dec 10
+" Version: 1.5
"
" Credits:
" David Necas (Yeti) <yeti@physics.muni.cz>
@@ -56,71 +56,120 @@ syn keyword fsMountPointKeyword contained none swap
" Type
syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown
syn match fsTypeUnknown /\s\+\zs\w\+/ contained
-syn keyword fsTypeKeyword contained adfs ados affs anon_inodefs atfs audiofs auto autofs bdev befs bfs btrfs binfmt_misc cd9660 cfs cgroup cifs coda configfs cpuset cramfs devfs devpts devtmpfs e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse fuseblk fusectl hfs hpfs hugetlbfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix mqueue msdos ncpfs nfs nfsd nilfs2 none ntfs null nwfs overlay ovlfs pipefs portal proc procfs pstore ptyfs qnx4 reiserfs ramfs romfs securityfs shm smbfs squashfs sockfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xenfs xfs zisofs
+syn keyword fsTypeKeyword contained adfs ados affs anon_inodefs atfs audiofs auto autofs bdev befs bfs btrfs binfmt_misc cd9660 ceph cfs cgroup cifs coda coherent configfs cpuset cramfs debugfs devfs devpts devtmpfs dlmfs e2compr ecryptfs efivarfs efs erofs exfat ext2 ext2fs ext3 ext4 f2fs fdesc ffs filecore fuse fuseblk fusectl gfs2 hfs hfsplus hpfs hugetlbfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix mqueue msdos ncpfs nfs nfs4 nfsd nilfs2 none ntfs ntfs3 null nwfs ocfs2 omfs overlay ovlfs pipefs portal proc procfs pstore ptyfs pvfs2 qnx4 qnx6 reiserfs ramfs romfs securityfs shm smbfs spufs squashfs sockfs sshfs std subfs swap sysfs sysv tcfs tmpfs ubifs udf ufs umap umsdos union usbfs userfs v9fs vfat virtiofs vs3fs vxfs wrapfs wvfs xenfs xenix xfs zisofs zonefs
" Options
" -------
" Options: General
syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeUnknown
syn match fsOptionsNumber /\d\+/
+syn match fsOptionsNumberSigned /[-+]\?\d\+/
syn match fsOptionsNumberOctal /[0-8]\+/
syn match fsOptionsString /[a-zA-Z0-9_-]\+/
+syn keyword fsOptionsTrueFalse true false
syn keyword fsOptionsYesNo yes no
+syn keyword fsOptionsYN y n
+syn keyword fsOptions01 0 1
syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck
syn keyword fsOptionsSize 512 1024 2048
syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail failok
syn match fsOptionsGeneral /_netdev/
+syn match fsOptionsKeywords contained /\<cache=/ nextgroup=fsOptionsCache
+syn keyword fsOptionsCache yes no none strict loose fscache mmap
+
+syn match fsOptionsKeywords contained /\<dax=/ nextgroup=fsOptionsDax
+syn keyword fsOptionsDax inode never always
+
+syn match fsOptionsKeywords contained /\<errors=/ nextgroup=fsOptionsErrors
+syn keyword fsOptionsErrors contained continue panic withdraw remount-ro recover zone-ro zone-offline repair
+
+syn match fsOptionsKeywords contained /\<\%(sec\)=/ nextgroup=fsOptionsSecurityMode
+syn keyword fsOptionsSecurityMode contained none krb5 krb5i ntlm ntlmi ntlmv2 ntlmv2i ntlmssp ntlmsspi sys lkey lkeyi lkeyp spkm spkmi spkmp
+
" Options: adfs
syn match fsOptionsKeywords contained /\<\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<ftsuffix=/ nextgroup=fsOptions01
" Options: affs
-syn match fsOptionsKeywords contained /\<\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<mode=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<\%(set[ug]id\|reserved\)=/ nextgroup=fsOptionsNumber
syn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsString
syn match fsOptionsKeywords contained /\<bs=/ nextgroup=fsOptionsSize
-syn keyword fsOptionsKeywords contained protect usemp verbose
+syn keyword fsOptionsKeywords contained protect usemp verbose nofilenametruncate mufs
" Options: btrfs
-syn match fsOptionsKeywords contained /\<\%(subvol\|subvolid\|subvolrootid\|device\|compress\|compress-force\|fatal_errors\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<\%(subvol\|subvolid\|subvolrootid\|device\|compress\|compress-force\|check_int_print_mask\|space_cache\)=/ nextgroup=fsOptionsString
syn match fsOptionsKeywords contained /\<\%(max_inline\|alloc_start\|thread_pool\|metadata_ratio\|check_int_print_mask\)=/ nextgroup=fsOptionsNumber
-syn keyword fsOptionsKeywords contained degraded nodatasum nodatacow nobarrier ssd ssd_spread noacl notreelog flushoncommit space_cache nospace_cache clear_cache user_subvol_rm_allowed autodefrag inode_cache enospc_debug recovery check_int check_int_data skip_balance discard
+syn match fsOptionsKeywords contained /\<discard=/ nextgroup=fsOptionsBtrfsDiscard
+syn keyword fsOptionsBtrfsDiscard sync async
+syn match fsOptionsKeywords contained /\<fatal_errors=/ nextgroup=fsOptionsBtrfsFatalErrors
+syn keyword fsOptionsBtrfsFatalErrors bug panic
+syn match fsOptionsKeywords contained /\<fragment=/ nextgroup=fsOptionsBtrfsFragment
+syn keyword fsOptionsBtrfsFragment data metadata all
+syn keyword fsOptionsKeywords contained degraded datasum nodatasum datacow nodatacow barrier nobarrier ssd ssd_spread nossd nossd_spread noacl treelog notreelog flushoncommit noflushoncommit space_cache nospace_cache clear_cache user_subvol_rm_allowed autodefrag noautodefrag inode_cache noinode_cache enospc_debug noenospc_debug recovery check_int check_int_data skip_balance discard nodiscard compress compress-force nologreplay rescan_uuid_tree rescue usebackuproot
" Options: cd9660
syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet
+" Options: ceph
+syn match fsOptionsKeywords contained /\<\%(mon_addr\|fsid\|rasize\|mount_timeout\|caps_max\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained rbytes norbytes nocrc dcache nodcache noasyncreaddir noquotadf nocopyfrom
+syn match fsOptionsKeywords contained /\<recover_session=/ nextgroup=fsOptionsCephRecoverSession
+syn keyword fsOptionsCephRecoverSession contained no clean
+
+" Options: cifs
+syn match fsOptionsKeywords contained /\<\%(user\|password\|credentials\|servernetbiosname\|servern\|netbiosname\|file_mode\|dir_mode\|ip\|domain\|prefixpath\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<\%(cruid\|backupuid\|backupgid\)=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsKeywords contained forceuid forcegid guest setuids nosetuids perm noperm dynperm strictcache rwpidforward mapchars nomapchars cifsacl nocase ignorecase nobrl sfu serverino noserverino nounix fsc multiuser posixpaths noposixpaths
+
" Options: devpts
" -- everything already defined
+" Options: ecryptfs
+syn match fsOptionsKeywords contained /\<\%(ecryptfs_\%(sig\|fnek_sig\|cipher\|key_bytes\)\|key\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained ecryptfs_passthrough no_sig_cache ecryptfs_encrypted_view ecryptfs_xattr
+syn match fsOptionsKeywords contained /\<ecryptfs_enable_filename_crypto=/ nextgroup=fsOptionsYN
+syn match fsOptionsKeywords contained /\<verbosity=/ nextgroup=fsOptions01
+
+" Options: erofs
+syn match fsOptionsKeywords contained /\<cache_strategy=/ nextgroup=fsOptionsEroCacheStrategy
+syn keyword fsOptionsEroCacheStrategy contained disabled readahead readaround
+
" Options: ext2
syn match fsOptionsKeywords contained /\<check=*/ nextgroup=@fsOptionsCheckCluster
-syn match fsOptionsKeywords contained /\<errors=/ nextgroup=fsOptionsExt2Errors
syn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumber
syn keyword fsOptionsExt2Check contained none normal strict
-syn keyword fsOptionsExt2Errors contained continue panic
-syn match fsOptionsExt2Errors contained /\<remount-ro\>/
+syn match fsOptionsErrors contained /\<remount-ro\>/
syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr
" Options: ext3
syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journal
syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Data
+syn match fsOptionsKeywords contained /\<data_err=/ nextgroup=fsOptionsExt3DataErr
syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<jqfmt=/ nextgroup=fsOptionsExt3Jqfmt
+syn match fsOptionsKeywords contained /\<\%(usrjquota\|grpjquota\)=/ nextgroup=fsOptionsString
syn keyword fsOptionsExt3Journal contained update inum
syn keyword fsOptionsExt3Data contained journal ordered writeback
+syn keyword fsOptionsExt3DataErr contained ignore abort
+syn keyword fsOptionsExt3Jqfmt contained vfsold vfsv0 vfsv1
syn keyword fsOptionsKeywords contained noload user_xattr nouser_xattr acl
" Options: ext4
syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt4Journal
syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt4Data
-syn match fsOptionsKeywords contained /\<barrier=/ nextgroup=fsOptionsExt4Barrier
+syn match fsOptionsKeywords contained /\<barrier=/ nextgroup=fsOptions01
syn match fsOptionsKeywords contained /\<journal_dev=/ nextgroup=fsOptionsNumber
syn match fsOptionsKeywords contained /\<resuid=/ nextgroup=fsOptionsNumber
syn match fsOptionsKeywords contained /\<resgid=/ nextgroup=fsOptionsNumber
syn match fsOptionsKeywords contained /\<sb=/ nextgroup=fsOptionsNumber
-syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<\%(commit\|inode_readahead_blks\|stripe\|max_batch_time\|min_batch_time\|init_itable\|max_dir_size_kb\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<journal_ioprio=/ nextgroup=fsOptionsExt4JournalIoprio
syn keyword fsOptionsExt4Journal contained update inum
syn keyword fsOptionsExt4Data contained journal ordered writeback
-syn match fsOptionsExt4Barrier /[0-1]/
-syn keyword fsOptionsKeywords contained noload extents orlov oldalloc user_xattr nouser_xattr acl noacl reservation noreservation bsddf minixdf check=none nocheck debug grpid nogroupid sysvgroups bsdgroups quota noquota grpquota usrquota bh nobh
+syn keyword fsOptionsExt4JournalIoprio contained 0 1 2 3 4 5 6 7
+syn keyword fsOptionsKeywords contained noload extents orlov oldalloc user_xattr nouser_xattr acl noacl reservation noreservation bsddf minixdf check=none nocheck debug grpid nogroupid sysvgroups bsdgroups quota noquota grpquota usrquota bh nobh journal_checksum nojournal_checksum journal_async_commit delalloc nodelalloc auto_da_alloc noauto_da_alloc noinit_itable block_validity noblock_validity dioread_lock dioread_nolock i_version nombcache prjquota
" Options: fat
syn match fsOptionsKeywords contained /\<blocksize=/ nextgroup=fsOptionsSize
@@ -135,39 +184,124 @@ syn keyword fsOptionsConv contained b t a binary text auto
syn keyword fsOptionsFatType contained 12 16 32
syn keyword fsOptionsKeywords contained quiet sys_immutable showexec dots nodots
+" Options: fuse
+syn match fsOptionsKeywords contained /\<\%(fd\|user_id\|group_id\|blksize\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<\%(rootmode\)=/ nextgroup=fsOptionsString
+
" Options: hfs
-syn match fsOptionsKeywords contained /\<\%(creator|type\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<\%(creator\|type\)=/ nextgroup=fsOptionsString
syn match fsOptionsKeywords contained /\<\%(dir\|file\|\)_umask=/ nextgroup=fsOptionsNumberOctal
syn match fsOptionsKeywords contained /\<\%(session\|part\)=/ nextgroup=fsOptionsNumber
+" Options: hfsplus
+syn match fsOptionsKeywords contained /\<nls=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained decompose nodecompose
+
+" Options: f2fs
+syn match fsOptionsKeywords contained /\<background_gc=/ nextgroup=fsOptionsF2fsBackgroundGc
+syn keyword fsOptionsF2fsBackgroundGc contained on off sync
+syn match fsOptionsKeywords contained /\<active_logs=/ nextgroup=fsOptionsF2fsActiveLogs
+syn keyword fsOptionsF2fsActiveLogs contained 2 4 6
+syn match fsOptionsKeywords contained /\<alloc_mode=/ nextgroup=fsOptionsF2fsAllocMode
+syn keyword fsOptionsF2fsAllocMode contained reuse default
+syn match fsOptionsKeywords contained /\<fsync_mode=/ nextgroup=fsOptionsF2fsFsyncMode
+syn keyword fsOptionsF2fsFsyncMode contained posix strict nobarrier
+syn match fsOptionsKeywords contained /\<compress_mode=/ nextgroup=fsOptionsF2fsCompressMode
+syn keyword fsOptionsF2fsCompressMode contained fs user
+syn match fsOptionsKeywords contained /\<discard_unit=/ nextgroup=fsOptionsF2fsDiscardUnit
+syn keyword fsOptionsF2fsDiscardUnit contained block segment section
+syn match fsOptionsKeywords contained /\<memory=/ nextgroup=fsOptionsF2fsMemory
+syn keyword fsOptionsF2fsMemory contained normal low
+syn match fsOptionsKeywords contained /\<\%(inline_xattr_size\|reserve_root\|fault_injection\|fault_type\|io_bits\|compress_log_size\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<\%(prjjquota\|test_dummy_encryption\|checkpoint\|compress_algorithm\|compress_extension\|nocompress_extension\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeyWords contained gc_merge nogc_merge disable_roll_forward no_heap disable_ext_identify inline_xattr noinline_xattr inline_data noinline_data inline_dentry noinline_dentry flush_merge fastboot extent_cache noextent_cache data_flush offusrjquota offgrpjquota offprjjquota test_dummy_encryption checkpoint_merge nocheckpoint_merge compress_chksum compress_cache inlinecrypt atgc
+
" Options: ffs
syn keyword fsOptionsKeyWords contained noperm softdep
+" Options: gfs2
+syn match fsOptionsKeywords contained /\<\%(lockproto\|locktable\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<\%(quota_quantum\|statfs_quantum\|statfs_percent\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<quota=/ nextgroup=fsOptionsGfs2Quota
+syn keyword fsOptionsGfs2Quota contained off account on
+syn keyword fsOptionsKeywords contained localcaching localflocks ignore_local_fs upgrade spectator meta
+
" Options: hpfs
syn match fsOptionsKeywords contained /\<case=/ nextgroup=fsOptionsHpfsCase
syn keyword fsOptionsHpfsCase contained lower asis
+syn match fsOptionsKeywords contained /\<chkdsk=/ nextgroup=fsOptionsHpfsChkdsk
+syn keyword fsOptionsHpfsChkdsk contained no errors always
+syn match fsOptionsKeywords contained /\<eas=/ nextgroup=fsOptionsHpfsEas
+syn keyword fsOptionsHpfsEas contained no ro rw
+syn match fsOptionsKeywords contained /\<timeshift=/ nextgroup=fsOptionsNumberSigned
" Options: iso9660
syn match fsOptionsKeywords contained /\<map=/ nextgroup=fsOptionsIsoMap
syn match fsOptionsKeywords contained /\<block=/ nextgroup=fsOptionsSize
-syn match fsOptionsKeywords contained /\<\%(session\|sbsector\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<\%(session\|sbsector\|dmode\)=/ nextgroup=fsOptionsNumber
syn keyword fsOptionsIsoMap contained n o a normal off acorn
-syn keyword fsOptionsKeywords contained norock nojoilet unhide cruft
+syn keyword fsOptionsKeywords contained norock nojoliet hide unhide cruft overriderockperm showassoc
syn keyword fsOptionsConv contained m mtext
" Options: jfs
syn keyword fsOptionsKeywords nointegrity integrity
" Options: nfs
-syn match fsOptionsKeywords contained /\<\%(rsize\|wsize\|timeo\|retrans\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mounthost\|mountprog\|mountvers\|nfsprog\|nfsvers\|namelen\)=/ nextgroup=fsOptionsString
-syn keyword fsOptionsKeywords contained bg fg soft hard intr cto ac tcp udp lock nobg nofg nosoft nohard nointr noposix nocto noac notcp noudp nolock
+syn match fsOptionsKeywords contained /\<lookupcache=/ nextgroup=fsOptionsNfsLookupCache
+syn keyword fsOptionsNfsLookupCache contained all none pos positive
+syn match fsOptionsKeywords contained /\<local_lock=/ nextgroup=fsOptionsNfsLocalLock
+syn keyword fsOptionsNfsLocalLock contained all flock posix none
+syn match fsOptionsKeywords contained /\<\%(mounthost\|mountprog\|nfsprog\|namelen\|proto\|mountproto\|clientaddr\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<\%(timeo\|retrans\|[rw]size\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mountvers\|namlen\|nfsvers\|vers\|minorversion\)=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsKeywords contained bg fg soft hard intr cto ac tcp udp lock nobg nofg nosoft nohard nointr noposix nocto noac notcp noudp nolock sharecache nosharecache resvport noresvport rdirplus nordirplus
+
+" Options: nilfs2
+syn match fsOptionsKeywords contained /\<order=/ nextgroup=fsOptionsNilfs2Order
+syn keyword fsOptionsNilfs2Order contained relaxed strict
+syn match fsOptionsKeywords contained /\<\%([cp]p\)=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsKeywords contained nogc
" Options: ntfs
+syn match fsOptionsKeywords contained /\<mft_zone_multiplier=/ nextgroup=fsOptionsNtfsMftZoneMultiplier
+syn keyword fsOptionsNtfsMftZoneMultiplier contained 1 2 3 4
syn match fsOptionsKeywords contained /\<\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<\%(sloppy\|show_sys_files\|case_sensitive\|disable_sparse\)=/ nextgroup=fsOptionsTrueFalse
syn keyword fsOptionsKeywords contained utf8
+" Options: ntfs3
+syn keyword fsOptionsKeywords contained noacsrules nohidden sparse showmeta prealloc
+
+" Options: ntfs-3g
+syn match fsOptionsKeywords contained /\<\%(usermapping\|locale\|streams_interface\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained permissions inherit recover norecover ignore_case remove_hiberfile hide_hid_files hide_dot_files windows_names silent no_def_opts efs_raw compression nocompression no_detach
+
+" Options: ocfs2
+syn match fsOptionsKeywords contained /\<\%(resv_level\|dir_resv_level\)=/ nextgroup=fsOptionsOcfs2ResvLevel
+syn keyword fsOptionsOcfs2ResvLevel contained 0 1 2 3 4 5 6 7 8
+syn match fsOptionsKeywords contained /\<coherency=/ nextgroup=fsOptionsOcfs2Coherency
+syn keyword fsOptionsOcfs2Coherency contained full buffered
+syn match fsOptionsKeywords contained /\<\%(atime_quantum\|preferred_slot\|localalloc\)=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsKeywords contained strictatime inode64
+
+" Options: overlay
+syn match fsOptionsKeywords contained /\<redirect_dir=/ nextgroup=fsOptionsOverlayRedirectDir
+syn keyword fsOptionsOverlayRedirectDir contained on follow off nofollow
+
" Options: proc
-" -- everything already defined
+syn match fsOptionsKeywords contained /\<\%(hidepid\|subset\)=/ nextgroup=fsOptionsString
+
+" Options: qnx4
+syn match fsOptionsKeywords contained /\<bitmap=/ nextgroup=fsOptionsQnx4Bitmap
+syn keyword fsOptionsQnx4Bitmap contained always lazy nonrmv
+syn keyword fsOptionsKeywords contained grown noembed overalloc unbusy
+
+" Options: qnx6
+syn match fsOptionsKeywords contained /\<hold=/ nextgroup=fsOptionsQnx6Hold
+syn keyword fsOptionsQnx6Hold contained allow root deny
+syn match fsOptionsKeywords contained /\<sync=/ nextgroup=fsOptionsQnx6Sync
+syn keyword fsOptionsQnx6Sync contained mandatory optional none
+syn match fsOptionsKeywords contained /\<snapshot=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsKeywords contained alignio
" Options: reiserfs
syn match fsOptionsKeywords contained /\<hash=/ nextgroup=fsOptionsReiserHash
@@ -176,7 +310,7 @@ syn keyword fsOptionsReiserHash contained rupasov tea r5 detect
syn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly
" Options: sshfs
-syn match fsOptionsKeywords contained /\<\%(BatchMode\|ChallengeResponseAuthentication\|CheckHostIP\|ClearAllForwardings\|Compression\|EnableSSHKeysign\|ForwardAgent\|ForwardX11\|ForwardX11Trusted\|GatewayPorts\|GSSAPIAuthentication\|GSSAPIDelegateCredentials\|HashKnownHosts\|HostbasedAuthentication\|IdentitiesOnly\|NoHostAuthenticationForLocalhost\|PasswordAuthentication\|PubkeyAuthentication\|RhostsRSAAuthentication\|RSAAuthentication\|TCPKeepAlive\|UsePrivilegedPort\|cache\)=/ nextgroup=fsOptionsYesNo
+syn match fsOptionsKeywords contained /\<\%(BatchMode\|ChallengeResponseAuthentication\|CheckHostIP\|ClearAllForwardings\|Compression\|EnableSSHKeysign\|ForwardAgent\|ForwardX11\|ForwardX11Trusted\|GatewayPorts\|GSSAPIAuthentication\|GSSAPIDelegateCredentials\|HashKnownHosts\|HostbasedAuthentication\|IdentitiesOnly\|NoHostAuthenticationForLocalhost\|PasswordAuthentication\|PubkeyAuthentication\|RhostsRSAAuthentication\|RSAAuthentication\|TCPKeepAlive\|UsePrivilegedPort\)=/ nextgroup=fsOptionsYesNo
syn match fsOptionsKeywords contained /\<\%(ControlMaster\|StrictHostKeyChecking\|VerifyHostKeyDNS\)=/ nextgroup=fsOptionsSshYesNoAsk
syn match fsOptionsKeywords contained /\<\%(AddressFamily\|BindAddress\|Cipher\|Ciphers\|ControlPath\|DynamicForward\|EscapeChar\|GlobalKnownHostsFile\|HostKeyAlgorithms\|HostKeyAlias\|HostName\|IdentityFile\|KbdInteractiveDevices\|LocalForward\|LogLevel\|MACs\|PreferredAuthentications\|Protocol\|ProxyCommand\|RemoteForward\|RhostsAuthentication\|SendEnv\|SmartcardDevice\|User\|UserKnownHostsFile\|XAuthLocation\|comment\|workaround\|idmap\|ssh_command\|sftp_server\|fsname\)=/ nextgroup=fsOptionsString
syn match fsOptionsKeywords contained /\<\%(CompressionLevel\|ConnectionAttempts\|ConnectTimeout\|NumberOfPasswordPrompts\|Port\|ServerAliveCountMax\|ServerAliveInterval\|cache_timeout\|cache_X_timeout\|ssh_protocol\|directport\|max_read\|umask\|uid\|gid\|entry_timeout\|negative_timeout\|attr_timeout\)=/ nextgroup=fsOptionsNumber
@@ -190,12 +324,19 @@ syn keyword fsOptionsKeywords contained procuid
" Options: swap
syn match fsOptionsKeywords contained /\<pri=/ nextgroup=fsOptionsNumber
+" Options: ubifs
+syn match fsOptionsKeywords contained /\<\%(compr\|auth_key\|auth_hash_name\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained bulk_read no_bulk_read chk_data_crc no_chk_data_crc
+
" Options: tmpfs
+syn match fsOptionsKeywords contained /\<huge=/ nextgroup=fsOptionsTmpfsHuge
+syn keyword fsOptionsTmpfsHuge contained never always within_size advise deny force
+syn match fsOptionsKeywords contained /\<\%(size\|mpol\)=/ nextgroup=fsOptionsString
syn match fsOptionsKeywords contained /\<nr_\%(blocks\|inodes\)=/ nextgroup=fsOptionsNumber
" Options: udf
syn match fsOptionsKeywords contained /\<\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsString
-syn keyword fsOptionsKeywords contained unhide undelete strict novrs
+syn keyword fsOptionsKeywords contained unhide undelete strict nostrict novrs adinicb noadinicb shortad longad
" Options: ufs
syn match fsOptionsKeywords contained /\<ufstype=/ nextgroup=fsOptionsUfsType
@@ -208,14 +349,32 @@ syn keyword fsOptionsUfsError contained panic lock umount repair
syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)\%(id\|gid\)=/ nextgroup=fsOptionsNumber
syn match fsOptionsKeywords contained /\<\%(dev\|bus\|list\)mode=/ nextgroup=fsOptionsNumberOctal
+" Options: v9fs
+syn match fsOptionsKeywords contained /\<\%(trans\)=/ nextgroup=fsOptionsV9Trans
+syn keyword fsOptionsV9Trans unix tcp fd virtio rdma
+syn match fsOptionsKeywords contained /\<debug=/ nextgroup=fsOptionsV9Debug
+syn keyword fsOptionsV9Debug 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 0x100 0x200 0x400 0x800
+syn match fsOptionsKeywords contained /\<version=/ nextgroup=fsOptionsV9Version
+syn keyword fsOptionsV9Version 9p2000 9p2000.u 9p2000.L
+syn match fsOptionsKeywords contained /\<\%([ua]name\|[rw]fdno\|access\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<msize=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsKeywords contained noextend dfltuid dfltgid afid nodevmap cachetag
+
" Options: vfat
-syn keyword fsOptionsKeywords contained nonumtail posix utf8
-syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortname
+syn match fsOptionsKeywords contained /\<shortname=/ nextgroup=fsOptionsVfatShortname
syn keyword fsOptionsVfatShortname contained lower win95 winnt mixed
+syn match fsOptionsKeywords contained /\<nfs=/ nextgroup=fsOptionsVfatNfs
+syn keyword fsOptionsVfatNfs contained stale_rw nostale_ro
+syn match fsOptionsKeywords contained /\<\%(tz\|dos1xfloppy\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /\<\%(allow_utime\|codepage\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\<time_offset=/ nextgroup=fsOptionsNumberSigned
+syn keyword fsOptionsKeywords contained nonumtail posix utf8 usefree flush rodir
" Options: xfs
-syn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString
-syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce
+syn match fsOptionsKeywords contained /\<logbufs=/ nextgroup=fsOptionsXfsLogBufs
+syn keyword fsOptionsXfsLogBufs contained 2 3 4 5 6 7 8
+syn match fsOptionsKeywords contained /\%(allocsize\|biosize\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime noquota norecovery osyncisdsync quota usrquota uqnoenforce grpquota gqnoenforce attr2 noattr2 filestreams ikeep noikeep inode32 inode64 largeio nolargeio nouuid uquota qnoenforce gquota pquota pqnoenforce swalloc wsync
" Frequency / Pass No.
syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassError
@@ -257,31 +416,71 @@ hi def link fsMountPointError Error
hi def link fsMountPointKeyword Keyword
hi def link fsFreqPassError Error
-hi def link fsOptionsGeneral Type
-hi def link fsOptionsKeywords Keyword
-hi def link fsOptionsNumber Number
-hi def link fsOptionsNumberOctal Number
-hi def link fsOptionsString String
-hi def link fsOptionsSize Number
+hi def link fsOptionsBtrfsDiscard String
+hi def link fsOptionsBtrfsFatalErrors String
+hi def link fsOptionsBtrfsFragment String
+hi def link fsOptionsCache String
+hi def link fsOptionsCephRecoverSession String
+hi def link fsOptionsConv String
+hi def link fsOptionsDax String
+hi def link fsOptionsEroCacheStrategy String
+hi def link fsOptionsErrors String
hi def link fsOptionsExt2Check String
-hi def link fsOptionsExt2Errors String
-hi def link fsOptionsExt3Journal String
hi def link fsOptionsExt3Data String
-hi def link fsOptionsExt4Journal String
+hi def link fsOptionsExt3DataErr String
+hi def link fsOptionsExt3Journal String
+hi def link fsOptionsExt3Jqfmt String
hi def link fsOptionsExt4Data String
-hi def link fsOptionsExt4Barrier Number
+hi def link fsOptionsExt4Journal String
+hi def link fsOptionsExt4JournalIoprio Number
+hi def link fsOptionsF2fsActiveLogs Number
+hi def link fsOptionsF2fsAllocMode String
+hi def link fsOptionsF2fsBackgroundGc String
+hi def link fsOptionsF2fsCompressMode String
+hi def link fsOptionsF2fsDiscardUnit String
+hi def link fsOptionsF2fsFsyncMode String
+hi def link fsOptionsF2fsMemory String
hi def link fsOptionsFatCheck String
-hi def link fsOptionsConv String
hi def link fsOptionsFatType Number
-hi def link fsOptionsYesNo String
+hi def link fsOptionsGeneral Type
+hi def link fsOptionsGfs2Quota String
hi def link fsOptionsHpfsCase String
+hi def link fsOptionsHpfsChkdsk String
+hi def link fsOptionsHpfsEas String
hi def link fsOptionsIsoMap String
+hi def link fsOptionsKeywords Keyword
+hi def link fsOptionsNfsLocalLock String
+hi def link fsOptionsNfsLookupCache String
+hi def link fsOptionsNilfs2Order String
+hi def link fsOptionsNtfsMftZoneMultiplier Number
+hi def link fsOptionsNumber Number
+hi def link fsOptionsNumberOctal Number
+hi def link fsOptionsNumberSigned Number
+hi def link fsOptionsOcfs2Coherency String
+hi def link fsOptionsOcfs2ResvLevel Number
+hi def link fsOptionsOverlayRedirectDir String
+hi def link fsOptionsQnx4Bitmap String
+hi def link fsOptionsQnx6Hold String
+hi def link fsOptionsQnx6Sync String
hi def link fsOptionsReiserHash String
+hi def link fsOptionsSecurityMode String
+hi def link fsOptionsSize Number
hi def link fsOptionsSshYesNoAsk String
-hi def link fsOptionsUfsType String
+hi def link fsOptionsString String
+hi def link fsOptionsTmpfsHuge String
hi def link fsOptionsUfsError String
-
+hi def link fsOptionsUfsType String
+hi def link fsOptionsV9Debug String
+hi def link fsOptionsV9Trans String
+hi def link fsOptionsV9Version String
+hi def link fsOptionsVfatNfs String
hi def link fsOptionsVfatShortname String
+hi def link fsOptionsXfsLogBufs Number
+
+hi def link fsOptionsTrueFalse Boolean
+hi def link fsOptionsYesNo String
+hi def link fsOptionsYN String
+hi def link fsOptions01 Number
let b:current_syntax = "fstab"
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 3a0ed5ffc5..78fb917764 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -296,12 +296,11 @@ local function ignore_invalid(s)
)
end
-local function ignore_parse_error(s, fname)
- local helpfile = vim.fs.basename(fname)
- return (helpfile == 'pi_netrw.txt'
+local function ignore_parse_error(s)
+ return (
-- Ignore parse errors for unclosed tag.
-- This is common in vimdocs and is treated as plaintext by :help.
- or s:find("^[`'|*]")
+ s:find("^[`'|*]")
)
end
@@ -370,7 +369,7 @@ local function visit_validate(root, level, lang_tree, opt, stats)
end
if node_name == 'ERROR' then
- if ignore_parse_error(text, opt.fname) then
+ if ignore_parse_error(text) then
return
end
-- Store the raw text to give context to the error report.
@@ -582,7 +581,7 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
end
return s
elseif node_name == 'ERROR' then
- if ignore_parse_error(trimmed, opt.fname) then
+ if ignore_parse_error(trimmed) then
return text
end
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c
index db84ecb5d8..ada042e654 100644
--- a/src/nvim/api/autocmd.c
+++ b/src/nvim/api/autocmd.c
@@ -361,41 +361,20 @@ cleanup:
return autocmd_list;
}
-/// Create an |autocommand|
+/// Creates an |autocommand| event handler, defined by `callback` (Lua function or Vimscript
+/// function _name_ string) or `command` (Ex command string).
///
-/// The API allows for two (mutually exclusive) types of actions to be executed when the autocommand
-/// triggers: a callback function (Lua or Vimscript), or a command (like regular autocommands).
-///
-/// Example using callback:
-/// <pre>lua
-/// -- Lua function
-/// local myluafun = function() print("This buffer enters") end
-///
-/// -- Vimscript function name (as a string)
-/// local myvimfun = "g:MyVimFunction"
-///
-/// vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
-/// pattern = {"*.c", "*.h"},
-/// callback = myluafun, -- Or myvimfun
-/// })
-/// </pre>
-///
-/// Lua functions receive a table with information about the autocmd event as an argument. To use
-/// a function which itself accepts another (optional) parameter, wrap the function
-/// in a lambda:
+/// Example using Lua callback:
/// <pre>lua
-/// -- Lua function with an optional parameter.
-/// -- The autocmd callback would pass a table as argument but this
-/// -- function expects number|nil
-/// local myluafun = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() end
-///
/// vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
/// pattern = {"*.c", "*.h"},
-/// callback = function() myluafun() end,
+/// callback = function(ev)
+/// print(string.format('event fired: %s', vim.inspect(ev)))
+/// end
/// })
/// </pre>
///
-/// Example using command:
+/// Example using an Ex command as the handler:
/// <pre>lua
/// vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
/// pattern = {"*.c", "*.h"},
@@ -403,46 +382,28 @@ cleanup:
/// })
/// </pre>
///
-/// Example values for pattern:
-/// <pre>lua
-/// pattern = "*.py"
-/// pattern = { "*.py", "*.pyi" }
-/// </pre>
-///
-/// Note: The `pattern` is passed to callbacks and commands as a literal string; environment
-/// variables like `$HOME` and `~` are not automatically expanded as they are by |:autocmd|.
-/// Instead, |expand()| such variables explicitly:
+/// Note: `pattern` is NOT automatically expanded (unlike with |:autocmd|), thus names like "$HOME"
+/// and "~" must be expanded explicitly:
/// <pre>lua
/// pattern = vim.fn.expand("~") .. "/some/path/*.py"
/// </pre>
///
-/// Example values for event:
-/// <pre>lua
-/// event = "BufWritePre"
-/// event = {"CursorHold", "BufWritePre", "BufWritePost"}
-/// </pre>
-///
-/// @param event (string|array) The event or events to register this autocommand
-/// @param opts Dictionary of autocommand options:
-/// - group (string|integer) optional: the autocommand group name or
-/// id to match against.
-/// - pattern (string|array) optional: pattern or patterns to match literally
-/// against |autocmd-pattern|.
-/// - buffer (integer) optional: buffer number for buffer local autocommands
+/// @param event (string|array) Event(s) that will trigger the handler (`callback` or `command`).
+/// @param opts Options dict:
+/// - group (string|integer) optional: autocommand group name or id to match against.
+/// - pattern (string|array) optional: pattern(s) to match literally |autocmd-pattern|.
+/// - buffer (integer) optional: buffer number for buffer-local autocommands
/// |autocmd-buflocal|. Cannot be used with {pattern}.
-/// - desc (string) optional: description of the autocommand.
-/// - callback (function|string) optional: if a string, the name of a Vimscript function
-/// to call when this autocommand is triggered. Otherwise, a Lua function which is
-/// called when this autocommand is triggered. Cannot be used with {command}. Lua
-/// callbacks can return true to delete the autocommand; in addition, they accept a
-/// single table argument with the following keys:
-/// - id: (number) the autocommand id
-/// - event: (string) the name of the event that triggered the autocommand
-/// |autocmd-events|
-/// - group: (number|nil) the autocommand group id, if it exists
-/// - match: (string) the expanded value of |<amatch>|
-/// - buf: (number) the expanded value of |<abuf>|
-/// - file: (string) the expanded value of |<afile>|
+/// - desc (string) optional: description (for documentation and troubleshooting).
+/// - callback (function|string) optional: Lua function (or Vimscript function name, if
+/// string) called when the event(s) is triggered. Lua callback can return true to
+/// delete the autocommand, and receives a table argument with these keys:
+/// - id: (number) autocommand id
+/// - event: (string) name of the triggered event |autocmd-events|
+/// - group: (number|nil) autocommand group id, if any
+/// - match: (string) expanded value of |<amatch>|
+/// - buf: (number) expanded value of |<abuf>|
+/// - file: (string) expanded value of |<afile>|
/// - data: (any) arbitrary data passed to |nvim_exec_autocmds()|
/// - command (string) optional: Vim command to execute on event. Cannot be used with
/// {callback}
@@ -451,7 +412,7 @@ cleanup:
/// - nested (boolean) optional: defaults to false. Run nested
/// autocommands |autocmd-nested|.
///
-/// @return Integer id of the created autocommand.
+/// @return Autocommand id (number)
/// @see |autocommand|
/// @see |nvim_del_autocmd()|
Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autocmd) *opts,
@@ -472,8 +433,7 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc
}
if (opts->callback.type != kObjectTypeNil && opts->command.type != kObjectTypeNil) {
- api_set_error(err, kErrorTypeValidation,
- "cannot pass both: 'callback' and 'command' for the same autocmd");
+ api_set_error(err, kErrorTypeValidation, "specify either 'callback' or 'command', not both");
goto cleanup;
} else if (opts->callback.type != kObjectTypeNil) {
// TODO(tjdevries): It's possible we could accept callable tables,
diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c
index b406672aa5..bdc0900dd9 100644
--- a/src/nvim/api/extmark.c
+++ b/src/nvim/api/extmark.c
@@ -66,7 +66,7 @@ Integer nvim_create_namespace(String name)
return (Integer)id;
}
-/// Gets existing, non-anonymous namespaces.
+/// Gets existing, non-anonymous |namespace|s.
///
/// @return dict that maps from names to namespace ids.
Dictionary nvim_get_namespaces(void)
@@ -195,7 +195,7 @@ static Array extmark_to_array(const ExtmarkInfo *extmark, bool id, bool add_dict
return rv;
}
-/// Gets the position (0-indexed) of an extmark.
+/// Gets the position (0-indexed) of an |extmark|.
///
/// @param buffer Buffer handle, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
@@ -249,7 +249,7 @@ ArrayOf(Integer) nvim_buf_get_extmark_by_id(Buffer buffer, Integer ns_id,
return extmark_to_array(&extmark, false, details);
}
-/// Gets extmarks in "traversal order" from a |charwise| region defined by
+/// Gets |extmarks| in "traversal order" from a |charwise| region defined by
/// buffer positions (inclusive, 0-indexed |api-indexing|).
///
/// Region can be given as (row,col) tuples, or valid extmark ids (whose
@@ -368,7 +368,7 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e
return rv;
}
-/// Creates or updates an extmark.
+/// Creates or updates an |extmark|.
///
/// By default a new extmark is created when no id is passed in, but it is also
/// possible to create a new mark by passing in a previously unused id or move
@@ -814,7 +814,7 @@ error:
return 0;
}
-/// Removes an extmark.
+/// Removes an |extmark|.
///
/// @param buffer Buffer handle, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
@@ -929,7 +929,7 @@ Integer nvim_buf_add_highlight(Buffer buffer, Integer ns_id, String hl_group, In
return ns_id;
}
-/// Clears namespaced objects (highlights, extmarks, virtual text) from
+/// Clears |namespace|d objects (highlights, |extmarks|, virtual text) from
/// a region.
///
/// Lines are 0-indexed. |api-indexing| To clear the namespace in the entire
@@ -962,12 +962,12 @@ void nvim_buf_clear_namespace(Buffer buffer, Integer ns_id, Integer line_start,
(int)line_end - 1, MAXCOL);
}
-/// Set or change decoration provider for a namespace
+/// Set or change decoration provider for a |namespace|
///
/// This is a very general purpose interface for having lua callbacks
/// being triggered during the redraw code.
///
-/// The expected usage is to set extmarks for the currently
+/// The expected usage is to set |extmarks| for the currently
/// redrawn buffer. |nvim_buf_set_extmark()| can be called to add marks
/// on a per-window or per-lines basis. Use the `ephemeral` key to only
/// use the mark for the current screen redraw (the callback will be called
@@ -1051,7 +1051,7 @@ error:
decor_provider_clear(p);
}
-/// Gets the line and column of an extmark.
+/// Gets the line and column of an |extmark|.
///
/// Extmarks may be queried by position, name or even special names
/// in the future such as "cursor".
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 857c03eb27..70b07dabe8 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -1825,7 +1825,7 @@ Dictionary nvim__stats(void)
/// - "width" Requested width of the UI
/// - "rgb" true if the UI uses RGB colors (false implies |cterm-colors|)
/// - "ext_..." Requested UI extensions, see |ui-option|
-/// - "chan" Channel id of remote UI (not present for TUI)
+/// - "chan" Channel id of remote UI or 0 for TUI
Array nvim_list_uis(void)
FUNC_API_SINCE(4)
{
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 8fd7cb08f0..bd77df1704 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1609,7 +1609,8 @@ static int command_line_insert_reg(CommandLineState *s)
ccline.special_char = NUL;
redrawcmd();
- return CMDLINE_CHANGED;
+ // The text has been stuffed, the command line didn't change yet.
+ return CMDLINE_NOT_CHANGED;
}
/// Handle the Left and Right mouse clicks in the command-line mode.
@@ -1690,7 +1691,7 @@ static void command_line_next_histidx(CommandLineState *s, bool next_match)
}
/// Handle the Up, Down, Page Up, Page down, CTRL-N and CTRL-P key in the
-/// command-line mode. The pressed key is in 'c'.
+/// command-line mode.
static int command_line_browse_history(CommandLineState *s)
{
if (s->histype == HIST_INVALID || get_hislen() == 0 || s->firstc == NUL) {
diff --git a/src/nvim/linematch.c b/src/nvim/linematch.c
index ebedda9b4d..629a31c913 100644
--- a/src/nvim/linematch.c
+++ b/src/nvim/linematch.c
@@ -85,7 +85,7 @@ static void update_path_flat(diffcmppath_T *diffcmppath, int score, size_t to, s
diffcmppath[to].df_path_idx = path_idx + 1;
}
-#define MATCH_CHAR_MAX_LEN 500
+#define MATCH_CHAR_MAX_LEN 800
/// Return matching characters between "s1" and "s2" whilst respecting sequence order.
/// Consider the case of two strings 'AAACCC' and 'CCCAAA', the
@@ -102,8 +102,8 @@ static void update_path_flat(diffcmppath_T *diffcmppath, int score, size_t to, s
/// @param s2
static int matching_chars(const char *s1, const char *s2)
{
- size_t s1len = MIN(MATCH_CHAR_MAX_LEN, line_len(s1));
- size_t s2len = MIN(MATCH_CHAR_MAX_LEN, line_len(s2));
+ size_t s1len = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(s1));
+ size_t s2len = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(s2));
int matrix[2][MATCH_CHAR_MAX_LEN] = { 0 };
bool icur = 1; // save space by storing only two rows for i axis
for (size_t i = 0; i < s1len; i++) {
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index 25a99c58ba..dfb4cc2625 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -280,6 +280,7 @@ typedef struct {
char_u *end;
} line[NSUBEXP];
} list;
+ colnr_T orig_start_col; // list.multi[0].start_col without \zs
} regsub_T;
typedef struct {
@@ -4431,6 +4432,7 @@ static void copy_sub(regsub_T *to, regsub_T *from)
if (REG_MULTI) {
memmove(&to->list.multi[0], &from->list.multi[0],
sizeof(struct multipos) * (size_t)from->in_use);
+ to->orig_start_col = from->orig_start_col;
} else {
memmove(&to->list.line[0], &from->list.line[0],
sizeof(struct linepos) * (size_t)from->in_use);
@@ -5781,12 +5783,12 @@ static int skip_to_start(int c, colnr_T *colp)
// Check for a match with match_text.
// Called after skip_to_start() has found regstart.
// Returns zero for no match, 1 for a match.
-static long find_match_text(colnr_T startcol, int regstart, char_u *match_text)
+static long find_match_text(colnr_T *startcol, int regstart, char_u *match_text)
{
#define PTR2LEN(x) utf_ptr2len(x)
- colnr_T col = startcol;
- int regstart_len = PTR2LEN((char *)rex.line + startcol);
+ colnr_T col = *startcol;
+ int regstart_len = PTR2LEN((char *)rex.line + col);
for (;;) {
bool match = true;
@@ -5819,6 +5821,7 @@ static long find_match_text(colnr_T startcol, int regstart, char_u *match_text)
rex.reg_startp[0] = rex.line + col;
rex.reg_endp[0] = s2;
}
+ *startcol = col;
return 1L;
}
@@ -5828,6 +5831,8 @@ static long find_match_text(colnr_T startcol, int regstart, char_u *match_text)
break;
}
}
+
+ *startcol = col;
return 0L;
#undef PTR2LEN
@@ -5931,6 +5936,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
if (REG_MULTI) {
m->norm.list.multi[0].start_lnum = rex.lnum;
m->norm.list.multi[0].start_col = (colnr_T)(rex.input - rex.line);
+ m->norm.orig_start_col = m->norm.list.multi[0].start_col;
} else {
m->norm.list.line[0].start = rex.input;
}
@@ -7110,6 +7116,8 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
if (REG_MULTI) {
m->norm.list.multi[0].start_col =
(colnr_T)(rex.input - rex.line) + clen;
+ m->norm.orig_start_col =
+ m->norm.list.multi[0].start_col;
} else {
m->norm.list.line[0].start = rex.input + clen;
}
@@ -7243,6 +7251,9 @@ static long nfa_regtry(nfa_regprog_T *prog, colnr_T col, proftime_T *tm, int *ti
rex.reg_endpos[i].lnum = subs.norm.list.multi[i].end_lnum;
rex.reg_endpos[i].col = subs.norm.list.multi[i].end_col;
}
+ if (rex.reg_mmatch != NULL) {
+ rex.reg_mmatch->rmm_matchcol = subs.norm.orig_start_col;
+ }
if (rex.reg_startpos[0].lnum < 0) {
rex.reg_startpos[0].lnum = 0;
@@ -7385,7 +7396,7 @@ static long nfa_regexec_both(char_u *line, colnr_T startcol, proftime_T *tm, int
// If match_text is set it contains the full text that must match.
// Nothing else to try. Doesn't handle combining chars well.
if (prog->match_text != NULL && !rex.reg_icombine) {
- retval = find_match_text(col, prog->regstart, prog->match_text);
+ retval = find_match_text(&col, prog->regstart, prog->match_text);
if (REG_MULTI) {
rex.reg_mmatch->rmm_matchcol = col;
} else {
@@ -7427,10 +7438,6 @@ theend:
|| (end->lnum == start->lnum && end->col < start->col)) {
rex.reg_mmatch->endpos[0] = rex.reg_mmatch->startpos[0];
}
-
- // startpos[0] may be set by "\zs", also return the column where
- // the whole pattern matched.
- rex.reg_mmatch->rmm_matchcol = col;
} else {
if (rex.reg_match->endp[0] < rex.reg_match->startp[0]) {
rex.reg_match->endp[0] = rex.reg_match->startp[0];
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 0ab82e6bcd..b9f32b2db9 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -2235,6 +2235,30 @@ func Test_recalling_cmdline()
cunmap <Plug>(save-cmdline)
endfunc
+func Test_cmd_map_cmdlineChanged()
+ let g:log = []
+ cnoremap <F1> l<Cmd><CR>s
+ augroup test
+ autocmd!
+ autocmd CmdlineChanged : let g:log += [getcmdline()]
+ augroup END
+
+ call feedkeys(":\<F1>\<CR>", 'xt')
+ call assert_equal(['l', 'ls'], g:log)
+
+ let @b = 'b'
+ cnoremap <F1> a<C-R>b
+ let g:log = []
+ call feedkeys(":\<F1>\<CR>", 'xt')
+ call assert_equal(['a', 'ab'], g:log)
+
+ unlet g:log
+ cunmap <F1>
+ augroup test
+ autocmd!
+ augroup END
+endfunc
+
" Test for the 'suffixes' option
func Test_suffixes_opt()
call writefile([], 'Xfile')
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index e13ff77705..8dc4173d60 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -2959,6 +2959,7 @@ func Test_cwindow_highlight()
call writefile(lines, 'XtestCwindow')
let buf = RunVimInTerminal('-S XtestCwindow', #{rows: 12})
call VerifyScreenDump(buf, 'Test_quickfix_cwindow_1', {})
+
call term_sendkeys(buf, ":cnext\<CR>")
call VerifyScreenDump(buf, 'Test_quickfix_cwindow_2', {})
diff --git a/test/functional/api/autocmd_spec.lua b/test/functional/api/autocmd_spec.lua
index a923f5df0e..7fb52b097b 100644
--- a/test/functional/api/autocmd_spec.lua
+++ b/test/functional/api/autocmd_spec.lua
@@ -14,14 +14,14 @@ before_each(clear)
describe('autocmd api', function()
describe('nvim_create_autocmd', function()
- it('does not allow "command" and "callback" in the same autocmd', function()
- local ok, _ = pcall(meths.create_autocmd, "BufReadPost", {
+ it('"command" and "callback" are mutually exclusive', function()
+ local rv = pcall_err(meths.create_autocmd, "BufReadPost", {
pattern = "*.py,*.pyi",
command = "echo 'Should Have Errored",
- callback = "not allowed",
+ callback = "NotAllowed",
})
- eq(false, ok)
+ eq("specify either 'callback' or 'command', not both", rv)
end)
it('doesnt leak when you use ++once', function()
@@ -60,13 +60,13 @@ describe('autocmd api', function()
end)
it('does not allow passing buffer and patterns', function()
- local ok = pcall(meths.create_autocmd, "Filetype", {
+ local rv = pcall_err(meths.create_autocmd, "Filetype", {
command = "let g:called = g:called + 1",
buffer = 0,
pattern = "*.py",
})
- eq(false, ok)
+ eq("cannot pass both: 'pattern' and 'buffer' for the same autocmd", rv)
end)
it('does not allow passing invalid buffers', function()
diff --git a/test/functional/autocmd/cmdline_spec.lua b/test/functional/autocmd/cmdline_spec.lua
index c96501ead4..60c29170e2 100644
--- a/test/functional/autocmd/cmdline_spec.lua
+++ b/test/functional/autocmd/cmdline_spec.lua
@@ -223,7 +223,6 @@ describe('cmdline autocommands', function()
eq({'notification', 'CmdlineChanged', {{cmdtype='=', cmdlevel=2}, "1+1"}}, next_msg())
feed('<cr>')
eq({'notification', 'CmdlineLeave', {{cmdtype='=', cmdlevel=2, abort=false}}}, next_msg())
- eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x = "}}, next_msg())
eq({'notification', 'CmdlineChanged', {{cmdtype=':', cmdlevel=1}, "let x = 2"}}, next_msg())
feed('<cr>')
eq({'notification', 'CmdlineLeave', {{cmdtype=':', cmdlevel=1, abort=false}}}, next_msg())
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index c74e88f55d..e390619a5a 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -2187,6 +2187,22 @@ describe('lua stdlib', function()
end)
end) -- vim.opt
+ describe('opt_local', function()
+ it('should be able to append to an array list type option', function()
+ eq({ "foo,bar,baz,qux" }, exec_lua [[
+ local result = {}
+
+ vim.opt.tags = "foo,bar"
+ vim.opt_local.tags:append("baz")
+ vim.opt_local.tags:append("qux")
+
+ table.insert(result, vim.bo.tags)
+
+ return result
+ ]])
+ end)
+ end)
+
it('vim.cmd', function()
exec_lua [[
vim.cmd "autocmd BufNew * ++once lua BUF = vim.fn.expand('<abuf>')"
diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua
index 7a5494e9a5..e62a6f7086 100644
--- a/test/functional/plugin/lsp/semantic_tokens_spec.lua
+++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua
@@ -69,9 +69,12 @@ describe('semantic token highlighting', function()
[4] = { bold = true, foreground = Screen.colors.SeaGreen };
[5] = { foreground = tonumber('0x6a0dad') };
[6] = { foreground = Screen.colors.Blue1 };
+ [7] = { bold = true, foreground = Screen.colors.DarkCyan };
+ [8] = { bold = true, foreground = Screen.colors.SlateBlue };
}
command([[ hi link @namespace Type ]])
command([[ hi link @function Special ]])
+ command([[ hi @declaration gui=bold ]])
exec_lua(create_server_definition)
exec_lua([[
@@ -107,9 +110,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -199,9 +202,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -228,9 +231,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -251,9 +254,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -309,9 +312,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- ^int {3:x}(); |
+ ^int {8:x}(); |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {3:x} << "\n"; |
{6:#else} |
@@ -459,29 +462,6 @@ describe('semantic token highlighting', function()
{1:~ }|
|
]] }
-
- exec_lua([[
- vim.lsp.semantic_tokens.start(bufnr, client_id)
- ]])
-
- screen:expect { grid = [[
- #include <iostream> |
- |
- int main() |
- { |
- int x; |
- #ifdef __cplusplus |
- std::cout << x << "\n"; |
- #else |
- printf("%d\n", x); |
- #endif |
- } |
- ^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- |
- ]], unchanged = true }
end)
it('does not send delta requests if not supported by server', function()
@@ -512,9 +492,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -536,9 +516,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- ^int {2:x}(); |
+ ^int {7:x}(); |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
diff --git a/test/functional/ui/linematch_spec.lua b/test/functional/ui/linematch_spec.lua
index 5601908929..697677aa67 100644
--- a/test/functional/ui/linematch_spec.lua
+++ b/test/functional/ui/linematch_spec.lua
@@ -49,12 +49,11 @@ describe('Diff mode screen with 3 diffs open', function()
[8] = {background = Screen.colors.Red1, bold = true};
[10] = {foreground = Screen.colors.Brown};
[9] = {background = Screen.colors.Plum1};
-})
+ })
feed('<c-w>=')
feed(':windo set nu!<cr>')
-
-
end)
+
describe('setup the diff screen to look like a merge conflict with 3 files in diff mode', function()
before_each(function()
@@ -249,12 +248,11 @@ describe('Diff mode screen with 2 diffs open', function()
[8] = {background = Screen.colors.Red1, bold = true};
[10] = {foreground = Screen.colors.Brown};
[9] = {background = Screen.colors.Plum1};
-})
+ })
feed('<c-w>=')
feed(':windo set nu!<cr>')
-
-
end)
+
describe('setup a diff with 2 files and set linematch:30', function()
before_each(function()
feed(':set diffopt+=linematch:30<cr>')
@@ -979,3 +977,19 @@ something
end)
end)
end)
+
+describe('regressions', function()
+ local screen
+
+ it("doesn't crash with long lines", function()
+ clear()
+ feed(':set diffopt+=linematch:30<cr>')
+ screen = Screen.new(100, 20)
+ screen:attach()
+ -- line must be greater than MATCH_CHAR_MAX_LEN
+ helpers.curbufmeths.set_lines(0, -1, false, { string.rep('a', 1000)..'hello' })
+ helpers.exec 'vnew'
+ helpers.curbufmeths.set_lines(0, -1, false, { string.rep('a', 1010)..'world' })
+ helpers.exec 'windo diffthis'
+ end)
+end)