runtime(doc): clarify complete_match() and 'isexpand' option Commit: https://github.com/vim/vim/commit/ffc89e47d014178bcd0a681ff2c8e18470cc972b Author: glepnir <glephun...@gmail.com> Date: Sun Apr 27 14:59:17 2025 +0200
runtime(doc): clarify complete_match() and 'isexpand' option clarify complete_match() documentation to better explain its backward search behavior, argument handling, and return value format and add an example of isexpand closes: #17212 Signed-off-by: glepnir <glephun...@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 9f91f47d4..55a0731a8 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Apr 24 +*builtin.txt* For Vim version 9.1. Last change: 2025 Apr 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2034,8 +2034,11 @@ complete_info([{what}]) *complete_info()* Return type: dict<any> complete_match([{lnum}, {col}]) *complete_match()* - Returns a List of matches found according to the 'isexpand' - option. Each match is represented as a List containing + Searches backward from the given position and returns a List + of matches according to the 'isexpand' option. When no + arguments are provided, uses the current cursor position. + + Each match is represented as a List containing [startcol, trigger_text] where: - startcol: column position where completion should start, or -1 if no trigger position is found. For multi-character @@ -2047,9 +2050,6 @@ complete_match([{lnum}, {col}]) *complete_match()* When 'isexpand' is empty, uses the 'iskeyword' pattern "\k\+$" to find the start of the current keyword. - When no arguments are provided, uses the current cursor - position. - Examples: > set isexpand=.,->,/,/*,abc func CustomComplete() diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 03a6a6c5c..255b9d50f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Apr 24 +*options.txt* For Vim version 9.1. Last change: 2025 Apr 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4996,6 +4996,10 @@ A jump table for the options with a short description can be found at |Q_op|. Note: Use "\," to add a literal comma as trigger character, see |option-backslash|. + Examples: > + set isexpand=.,->,/*,\, +< + *'insertmode'* *'im'* *'noinsertmode'* *'noim'* 'insertmode' 'im' boolean (default off) global -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1u91c4-00B3KA-GL%40256bit.org.