diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/provider/clipboard.vim | 12 | ||||
-rw-r--r-- | runtime/autoload/tutor.vim | 2 | ||||
-rw-r--r-- | runtime/doc/api.txt | 6 | ||||
-rw-r--r-- | runtime/doc/autocmd.txt | 4 | ||||
-rw-r--r-- | runtime/doc/editing.txt | 2 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 3 | ||||
-rw-r--r-- | runtime/doc/news.txt | 8 | ||||
-rw-r--r-- | runtime/doc/options.txt | 35 | ||||
-rw-r--r-- | runtime/doc/tagsrch.txt | 2 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 1 | ||||
-rw-r--r-- | runtime/lua/vim/ui.lua | 15 |
12 files changed, 70 insertions, 21 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 026c01bce6..e4161290d9 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -97,18 +97,18 @@ function! provider#clipboard#Executable() abort let s:copy['*'] = ['wl-copy', '--foreground', '--primary', '--type', 'text/plain'] let s:paste['*'] = ['wl-paste', '--no-newline', '--primary'] return 'wl-copy' - elseif !empty($DISPLAY) && executable('xclip') - let s:copy['+'] = ['xclip', '-quiet', '-i', '-selection', 'clipboard'] - let s:paste['+'] = ['xclip', '-o', '-selection', 'clipboard'] - let s:copy['*'] = ['xclip', '-quiet', '-i', '-selection', 'primary'] - let s:paste['*'] = ['xclip', '-o', '-selection', 'primary'] - return 'xclip' elseif !empty($DISPLAY) && executable('xsel') && s:cmd_ok('xsel -o -b') let s:copy['+'] = ['xsel', '--nodetach', '-i', '-b'] let s:paste['+'] = ['xsel', '-o', '-b'] let s:copy['*'] = ['xsel', '--nodetach', '-i', '-p'] let s:paste['*'] = ['xsel', '-o', '-p'] return 'xsel' + elseif !empty($DISPLAY) && executable('xclip') + let s:copy['+'] = ['xclip', '-quiet', '-i', '-selection', 'clipboard'] + let s:paste['+'] = ['xclip', '-o', '-selection', 'clipboard'] + let s:copy['*'] = ['xclip', '-quiet', '-i', '-selection', 'primary'] + let s:paste['*'] = ['xclip', '-o', '-selection', 'primary'] + return 'xclip' elseif executable('lemonade') let s:copy['+'] = ['lemonade', 'copy'] let s:paste['+'] = ['lemonade', 'paste'] diff --git a/runtime/autoload/tutor.vim b/runtime/autoload/tutor.vim index abf5c5e2c8..4da4213826 100644 --- a/runtime/autoload/tutor.vim +++ b/runtime/autoload/tutor.vim @@ -104,7 +104,7 @@ function! tutor#CheckLine(line) if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect') let bufn = bufnr('%') let ctext = getline(a:line) - let signs = sign_getplaced('.', {'lnum': a:line})[0].signs + let signs = sign_getplaced(bufn, {'lnum': a:line})[0].signs if !empty(signs) call sign_unplace('', {'id': signs[0].id}) endif diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 8928650a39..9faff82f06 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1757,6 +1757,7 @@ nvim_create_user_command({name}, {command}, {*opts}) executed. When called from Lua, the command can also be a Lua function. The function is called with a single table argument that contains the following keys: + • name: (string) Command name • args: (string) The args passed to the command, if any |<args>| • fargs: (table) The args split by unescaped whitespace @@ -3068,6 +3069,11 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()* specified by character: [ {"+", "MyCorner"}, {"x", "MyBorder"} ]. + • title: Title (optional) in window border, String or list. + List is [text, highlight] tuples. if is string the default + highlight group is `FloatTitle`. + • title_pos: Title position must set with title option. + value can be of `left` `center` `right` default is left. • noautocmd: If true then no buffer-related autocommand events such as |BufEnter|, |BufLeave| or |BufWinEnter| may fire from calling this function. diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index da41c92df6..c30c190301 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -996,6 +996,10 @@ TextChangedP After a change was made to the text in the current buffer in Insert mode, only when the popup menu is visible. Otherwise the same as TextChanged. + *TextChangedT* +TextChangedT After a change was made to the text in the + current buffer in |Terminal-mode|. Otherwise + the same as TextChanged. *TextYankPost* TextYankPost Just after a |yank| or |deleting| command, but not if the black hole register |quote_| is used nor diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 58a5cbc60c..76c528ef3c 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -438,6 +438,8 @@ Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin* *++edit* 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 {value} cannot contain white space. It can be any valid value for these options. Examples: > diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index c4e139bca7..cab2f49d94 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1979,7 +1979,8 @@ input({opts}, {on_confirm}) *vim.ui.input()* highlighting user inputs. • {on_confirm} (function) ((input|nil) -> ()) Called once the user confirms or abort the input. `input` is what the user - typed. `nil` if the user aborted the dialog. + typed (it might be an empty string if nothing was + entered), or `nil` if the user aborted the dialog. select({items}, {opts}, {on_choice}) *vim.ui.select()* Prompts the user to pick a single item from a collection of entries diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 5f29fa8da9..d339df8479 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -41,9 +41,17 @@ The following new APIs or features were added. • When using Nvim inside tmux 3.2 or later, the default clipboard provider will now copy to the system clipboard. |provider-clipboard| + • 'splitkeep' option to control the scroll behavior of horizontal splits. + • |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu. +• |'diffopt'| now includes a `linematch` option to enable a second-stage diff + on individual hunks to provide much more accurate diffs. This option is also + available to |vim.diff()| + + See https://github.com/neovim/neovim/pull/14537. + ============================================================================== CHANGED FEATURES *news-changes* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 818c6d0115..4a277c146f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -313,14 +313,23 @@ Note: In the future more global options can be made |global-local|. Using *option-value-function* -Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc', -'operatorfunc', 'quickfixtextfunc' and 'tagfunc') are set to a function name -or a function reference or a lambda function. Examples: +Some options ('completefunc', 'omnifunc', 'operatorfunc', 'quickfixtextfunc', +'tagfunc' and 'thesaurusfunc') are set to a function name or a function +reference or a lambda function. When using a lambda it will be converted to +the name, e.g. "<lambda>123". Examples: > set opfunc=MyOpFunc - set opfunc=function("MyOpFunc") - set opfunc=funcref("MyOpFunc") - set opfunc={t\ ->\ MyOpFunc(t)} + set opfunc=function('MyOpFunc') + set opfunc=funcref('MyOpFunc') + set opfunc={a\ ->\ MyOpFunc(a)} + " set using a funcref variable + let Fn = function('MyTagFunc') + let &tagfunc = string(Fn) + " set using a lambda expression + let &tagfunc = {t -> MyTagFunc(t)} + " set using a variable with lambda expression + let L = {a, b, c -> MyTagFunc(a, b , c)} + let &tagfunc = L < Setting the filetype @@ -1446,7 +1455,9 @@ A jump table for the options with a short description can be found at |Q_op|. This option specifies a function to be used for Insert mode completion with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U| See |complete-functions| for an explanation of how the function is - invoked and what it should return. + invoked and what it should return. The value can be the name of a + function, a |lambda| or a |Funcref|. See |option-value-function| for + more information. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -4413,7 +4424,9 @@ A jump table for the options with a short description can be found at |Q_op|. This option specifies a function to be used for Insert mode omni completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| See |complete-functions| for an explanation of how the function is - invoked and what it should return. + invoked and what it should return. The value can be the name of a + function, a |lambda| or a |Funcref|. See |option-value-function| for + more information. This option is usually set by a filetype plugin: |:filetype-plugin-on| This option cannot be set from a |modeline| or in the |sandbox|, for @@ -6443,7 +6456,9 @@ A jump table for the options with a short description can be found at |Q_op|. This option specifies a function to be used to perform tag searches. The function gets the tag pattern and should return a List of matching tags. See |tag-function| for an explanation of how to write the - function and an example. + function and an example. The value can be the name of a function, a + |lambda| or a |Funcref|. See |option-value-function| for more + information. *'taglength'* *'tl'* 'taglength' 'tl' number (default 0) @@ -6566,6 +6581,8 @@ A jump table for the options with a short description can be found at |Q_op|. global or local to buffer |global-local| This option specifies a function to be used for thesaurus completion with CTRL-X CTRL-T. |i_CTRL-X_CTRL-T| See |compl-thesaurusfunc|. + The value can be the name of a function, a |lambda| or a |Funcref|. + See |option-value-function| for more information. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index d079db0717..aab6f78315 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -909,6 +909,8 @@ If the function returns |v:null| instead of a List, a standard tag lookup will be performed instead. It is not allowed to change the tagstack from inside 'tagfunc'. *E986* +It is not allowed to close a window or change window from inside 'tagfunc'. +*E1299* The following is a hypothetical example of a function used for 'tagfunc'. It uses the output of |taglist()| to generate the result: a list of tags in the diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index da2b5e2466..fe6c28c809 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -267,6 +267,7 @@ Options: 'tabline' %@Func@foo%X can call any function on mouse-click 'winblend' pseudo-transparency in floating windows |api-floatwin| 'winhighlight' window-local highlights + 'diffopt' has the option `linematch`. Signs: Signs are removed if the associated line is deleted. diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 56659eff04..5aa968e211 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1057,6 +1057,7 @@ local extension = { hdl = 'vhdl', vho = 'vhdl', vbe = 'vhdl', + tape = 'vhs', vim = 'vim', vba = 'vim', mar = 'vmasm', diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua index 6f1ce3089d..d9a3963afc 100644 --- a/runtime/lua/vim/ui.lua +++ b/runtime/lua/vim/ui.lua @@ -73,7 +73,8 @@ end --- user inputs. ---@param on_confirm function ((input|nil) -> ()) --- Called once the user confirms or abort the input. ---- `input` is what the user typed. +--- `input` is what the user typed (it might be +--- an empty string if nothing was entered), or --- `nil` if the user aborted the dialog. --- --- Example: @@ -88,11 +89,17 @@ function M.input(opts, on_confirm) }) opts = (opts and not vim.tbl_isempty(opts)) and opts or vim.empty_dict() + + -- Note that vim.fn.input({}) returns an empty string when cancelled. + -- vim.ui.input() should distinguish aborting from entering an empty string. + local _canceled = vim.NIL + opts = vim.tbl_extend('keep', opts, { cancelreturn = _canceled }) + local input = vim.fn.input(opts) - if #input > 0 then - on_confirm(input) - else + if input == _canceled then on_confirm(nil) + else + on_confirm(input) end end |