mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0220: completion of highlight names misses a few values
Problem: Completion for :match does not show "none" and other missing highlight names. Solution: Skip over cleared entries before checking the index to be at the end.
This commit is contained in:
13
src/syntax.c
13
src/syntax.c
@@ -9956,6 +9956,13 @@ highlight_list_two(int cnt, int attr)
|
||||
char_u *
|
||||
get_highlight_name(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
/* Items are never removed from the table, skip the ones that were cleared.
|
||||
*/
|
||||
while (idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
||||
++idx;
|
||||
|
||||
#ifdef FEAT_CMDL_COMPL
|
||||
if (idx == highlight_ga.ga_len && include_none != 0)
|
||||
return (char_u *)"none";
|
||||
@@ -9968,12 +9975,6 @@ get_highlight_name(expand_T *xp UNUSED, int idx)
|
||||
&& include_link != 0)
|
||||
return (char_u *)"clear";
|
||||
#endif
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
/* Items are never removed from the table, skip the ones that were cleared.
|
||||
*/
|
||||
while (idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
||||
++idx;
|
||||
if (idx >= highlight_ga.ga_len)
|
||||
return NULL;
|
||||
return HL_TABLE()[idx].sg_name;
|
||||
|
Reference in New Issue
Block a user