neovim/runtime
zeertzjq f06af5e669 vim-patch:9.0.1958: cannot complete option values
Problem:  cannot complete option values
Solution: Add completion functions for several options

Add cmdline tab-completion for setting string options

Add tab-completion for setting string options on the cmdline using
`:set=` (along with `:set+=` and `:set-=`).

The existing tab completion for setting options currently only works
when nothing is typed yet, and it only fills in with the existing value,
e.g. when the user does `:set diffopt=<Tab>` it will be completed to
`set diffopt=internal,filler,closeoff` and nothing else. This isn't too
useful as a user usually wants auto-complete to suggest all the possible
values, such as 'iblank', or 'algorithm:patience'.

For set= and set+=, this adds a new optional callback function for each
option that can be invoked when doing completion. This allows for each
option to have control over how completion works. For example, in
'diffopt', it will suggest the default enumeration, but if `algorithm:`
is selected, it will further suggest different algorithm types like
'meyers' and 'patience'. When using set=, the existing option value will
be filled in as the first choice to preserve the existing behavior. When
using set+= this won't happen as it doesn't make sense.

For flag list options (e.g. 'mouse' and 'guioptions'), completion will
take into account existing typed values (and in the case of set+=, the
existing option value) to make sure it doesn't suggest duplicates.

For set-=, there is a new `ExpandSettingSubtract` function which will
handle flag list and comma-separated options smartly, by only suggesting
values that currently exist in the option.

Note that Vim has some existing code that adds special handling for
'filetype', 'syntax', and misc dir options like 'backupdir'. This change
preserves them as they already work, instead of converting to the new
callback API for each option.

closes: vim/vim#13182

900894b09a

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-01 20:00:23 +08:00
..
autoload refactor(tutor): cleanup 2023-09-26 06:41:53 -07:00
colors vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
compiler vim-patch:fc93594d562d 2023-09-13 17:23:45 +02:00
doc vim-patch:9.0.1958: cannot complete option values 2023-10-01 20:00:23 +08:00
ftplugin vim-patch:347459423903 2023-09-27 22:20:03 +02:00
indent vim-patch:e30d8e4ce01d 2023-09-17 22:52:56 +02:00
keymap vim-patch:e8d6f03f6a61 2023-08-23 20:36:16 +01:00
lua Merge pull request #25455 from bfredl/highlight_namespace_getters 2023-10-01 10:39:31 +02:00
macros vim-patch:e8d6f03f6a61 2023-08-23 20:36:16 +01:00
pack/dist/opt refactor(termdebug): reindent some things 2023-08-25 11:24:52 +01:00
plugin feat(treesitter): add lang parameter to the query editor (#25181) 2023-09-16 19:05:59 +02:00
queries feat(lsp): use treesitter for stylize markdown 2023-09-19 14:47:37 +01:00
spell feat(runtime): import cleanadd.vim from Vim (#17699) 2022-03-13 04:52:45 +00:00
syntax vim-patch:54f70cf0780a 2023-09-27 22:20:03 +02:00
tools vim-patch:e80086446cc2 (#19848) 2022-08-20 10:04:55 +02:00
tutor fix(tutor): Tutor steps don't work on Windows #25251 2023-09-26 06:31:35 -07:00
CMakeLists.txt refactor(build): move the last generator from scripts/ to src/nvim/generators 2023-04-21 16:46:35 +02:00
delmenu.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
filetype.lua fix(filetype): make sure buffer is valid before call nvim_buf_call (#24922) 2023-08-30 10:14:58 -05:00
ftoff.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
ftplugin.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
ftplugof.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
indent.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
indoff.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
macmap.vim re-integrate runtime/ vim-patch:0 #938 2014-07-29 02:12:31 +00:00
makemenu.vim vim-patch:acb91d3905cf 2023-09-02 11:08:29 +02:00
menu.vim vim-patch:e059fae10044 2023-08-24 11:33:06 +09:00
mswin.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
neovim.ico feat(windows): show icon in terminal titlebar, taskbar #20607 2022-10-13 05:48:12 -07:00
nvim.appdata.xml NVIM v0.9.0 2023-04-07 13:26:29 +02:00
nvim.desktop build(nvim.desktop): central Kurdish translation #17065 2022-05-13 11:58:22 -07:00
nvim.png Dist: make icon a proper square (#9716) 2019-03-11 21:00:12 +01:00
optwin.vim vim-patch:0b8b145bf8bf 2023-08-31 10:58:54 +02:00
synmenu.vim vim-patch:acb91d3905cf 2023-09-02 11:08:29 +02:00