summaryrefslogtreecommitdiffstats
path: root/src/cmdexpand.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-17 18:25:32 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-17 18:25:32 +0200
commitd8c9340fc67ca19f82ec3e77ec38296424e758cf (patch)
tree40b666497cc92fc44b37316b8454aac1f1957441 /src/cmdexpand.c
parent84ac2126f470569c770cd22a52f8d48c50cd42a1 (diff)
patch 9.1.0495: Matched text isn't highlighted in cmdline pumv9.1.0495
Problem: Matched text isn't highlighted in cmdline pum. Solution: Use cmdline completion pattern in cmdline mode. (zeertzjq) closes: #15029 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r--src/cmdexpand.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 1008bf97e5..8d8bf06b5f 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -438,6 +438,28 @@ cmdline_compl_startcol(void)
}
/*
+ * Returns the current cmdline completion pattern.
+ */
+ char_u *
+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.
+ */
+ int
+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 a status match.
* These are backslashes used for escaping. Do show backslashes in help tags.
*/