vim-patch:9.0.1798: The 'syntax' option has no completion. (#24908)

Problem:  The 'syntax' option has no completion.
Solution: Add syntax option completion.

closes: vim/vim#12900

6dfdff3f27

N/A patches:
vim-patch:9.0.1795: Indentation issues

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
zeertzjq 2023-08-28 07:07:50 +08:00 committed by GitHub
parent d7d3d757c1
commit 6b12eda220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -5394,6 +5394,11 @@ void set_context_in_set_cmd(expand_T *xp, char *arg, int opt_flags)
xp->xp_pattern = p + 1;
if (options[opt_idx].var == &p_syn) {
xp->xp_context = EXPAND_OWNSYNTAX;
return;
}
if (flags & P_EXPAND) {
p = options[opt_idx].var;
if (p == (char *)&p_bdir

View File

@ -378,6 +378,12 @@ func Test_set_completion()
call assert_equal('"set filetype=sshdconfig', @:)
call feedkeys(":set filetype=a\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:)
" Expand values for 'syntax'
call feedkeys(":set syntax=sshdconfi\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"set syntax=sshdconfig', @:)
call feedkeys(":set syntax=a\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal('"set syntax=' .. getcompletion('a*', 'syntax')->join(), @:)
endfunc
func Test_set_option_errors()