vim-patch:9.1.0495: Matched text isn't highlighted in cmdline pum

Problem:  Matched text isn't highlighted in cmdline pum.
Solution: Use cmdline completion pattern in cmdline mode.
          (zeertzjq)

closes: vim/vim#15029

d8c9340fc6

Cherry-pick syntax.txt change from runtime update.
This commit is contained in:
zeertzjq
2024-06-18 05:49:33 +08:00
parent b60030b7bf
commit c429c5f86f
5 changed files with 116 additions and 6 deletions

View File

@@ -402,6 +402,20 @@ void cmdline_pum_cleanup(CmdlineInfo *cclp)
wildmenu_cleanup(cclp);
}
/// Returns the current cmdline completion pattern.
char *cmdline_compl_pattern(void)
{
expand_T *xp = get_cmdline_info()->xpc;
return xp == NULL ? NULL : xp->xp_orig;
}
/// Returns true if fuzzy cmdline completion is active, false otherwise.
bool cmdline_compl_is_fuzzy(void)
{
expand_T *xp = get_cmdline_info()->xpc;
return xp != NULL && cmdline_fuzzy_completion_supported(xp);
}
/// Return the number of characters that should be skipped in the wildmenu
/// These are backslashes used for escaping. Do show backslashes in help tags.
static int skip_wildmenu_char(expand_T *xp, char *s)