diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 2 | ||||
-rw-r--r-- | runtime/doc/autocmd.txt | 6 | ||||
-rw-r--r-- | runtime/doc/options.txt | 3 | ||||
-rw-r--r-- | runtime/doc/repeat.txt | 3 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 | ||||
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 23 |
6 files changed, 19 insertions, 19 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 02a27e15f8..0a8a3e9a2c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3282,7 +3282,7 @@ nvim_del_autocmd({id}) *nvim_del_autocmd()* See also: ~ |nvim_create_autocmd()| -nvim_do_autocmd({event}, {*opts}) *nvim_do_autocmd()* +nvim_exec_autocmd({event}, {*opts}) *nvim_exec_autocmd()* Execute an autocommand |autocmd-execute|. Parameters: ~ diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index ab0b0cd07c..54fb4c14a0 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -500,9 +500,9 @@ CursorMoved After the cursor was moved in Normal or Visual of the cursor line has been changed, e.g. with "x", "rx" or "p". Not triggered when there is typeahead, while - executing a script file, when an operator is - pending, or when moving to another window while - remaining at the same cursor position. + executing a script file, or when an operator + is pending. Always triggered when moving to + another window. For an example see |match-parens|. Note: Cannot be skipped with |:noautocmd|. Careful: This is triggered very often, don't diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 8323ec3e9d..c0a7b73438 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3670,8 +3670,7 @@ A jump table for the options with a short description can be found at |Q_op|. 0: never 1: only if there are at least two windows 2: always - 3: have a global statusline at the bottom instead of one for - each window + 3: always and ONLY the last window The screen looks nicer with a status line if you have several windows, but it takes another screen line. |status-line| diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 994f97bba0..508565dea4 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -182,8 +182,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. *:so* *:source* *load-vim-script* :[range]so[urce] [file] Runs |Ex| commands or Lua code (".lua" files) from - [file], or from the current buffer if no [file] is - given. + [file], or current buffer if no [file]. Triggers the |SourcePre| autocommand. *:source!* :[range]so[urce]! {file} diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 9ca5faf112..59f085977b 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -180,6 +180,7 @@ Commands: |:Man| is available by default, with many improvements such as completion |:sign-define| accepts a `numhl` argument, to highlight the line number |:match| can be invoked before highlight group is defined + |:source| works with Lua and anonymous (no file) scripts Events: |RecordingEnter| diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index fcb1e61764..1ec66d7c55 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -1224,6 +1224,18 @@ function M.open_float(opts, ...) opts = opts or {} bufnr = get_bufnr(bufnr or opts.bufnr) + + do + -- Resolve options with user settings from vim.diagnostic.config + -- Unlike the other decoration functions (e.g. set_virtual_text, set_signs, etc.) `open_float` + -- does not have a dedicated table for configuration options; instead, the options are mixed in + -- with its `opts` table which also includes "keyword" parameters. So we create a dedicated + -- options table that inherits missing keys from the global configuration before resolving. + local t = global_diagnostic_options.float + local float_opts = vim.tbl_extend("keep", opts, type(t) == "table" and t or {}) + opts = get_resolved_options({ float = float_opts }, nil, bufnr).float + end + local scope = ({l = "line", c = "cursor", b = "buffer"})[opts.scope] or opts.scope or "line" local lnum, col if scope == "line" or scope == "cursor" then @@ -1242,17 +1254,6 @@ function M.open_float(opts, ...) error("Invalid value for option 'scope'") end - do - -- Resolve options with user settings from vim.diagnostic.config - -- Unlike the other decoration functions (e.g. set_virtual_text, set_signs, etc.) `open_float` - -- does not have a dedicated table for configuration options; instead, the options are mixed in - -- with its `opts` table which also includes "keyword" parameters. So we create a dedicated - -- options table that inherits missing keys from the global configuration before resolving. - local t = global_diagnostic_options.float - local float_opts = vim.tbl_extend("keep", opts, type(t) == "table" and t or {}) - opts = get_resolved_options({ float = float_opts }, nil, bufnr).float - end - local diagnostics = get_diagnostics(bufnr, opts, true) if scope == "line" then |