# HG changeset patch # User Christian Brabandt # Date 1693155606 -7200 # Node ID 859e539d686b10b46aabf2f6bd3586d2f67c35e9 # Parent a38b40a531e6d1eb9a2ed773ef6067dc518b1626 patch 9.0.1798: The 'syntax' option has no completion. Commit: https://github.com/vim/vim/commit/6dfdff3f273dcea29099d81e3eceb871ae089998 Author: Doug Kearns Date: Sun Aug 27 18:48:51 2023 +0200 patch 9.0.1798: The 'syntax' option has no completion. Problem: The 'syntax' option has no completion. Solution: Add syntax option completion. closes: #12900 Signed-off-by: Christian Brabandt Co-authored-by: Doug Kearns diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -7374,6 +7374,14 @@ set_context_in_set_cmd( xp->xp_pattern = p + 1; +#ifdef FEAT_SYN_HL + if (options[opt_idx].var == (char_u *)&p_syn) + { + xp->xp_context = EXPAND_OWNSYNTAX; + return; + } +#endif + if (flags & P_EXPAND) { p = options[opt_idx].var; diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -374,6 +374,12 @@ func Test_set_completion() call assert_equal('"set filetype=sshdconfig', @:) call feedkeys(":set filetype=a\\\"\", 'xt') call assert_equal('"set filetype=' .. getcompletion('a*', 'filetype')->join(), @:) + + " Expand values for 'syntax' + call feedkeys(":set syntax=sshdconfi\\\"\", 'xt') + call assert_equal('"set syntax=sshdconfig', @:) + call feedkeys(":set syntax=a\\\"\", 'xt') + call assert_equal('"set syntax=' .. getcompletion('a*', 'syntax')->join(), @:) endfunc func Test_set_option_errors() diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -700,6 +700,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1798, +/**/ 1797, /**/ 1796,