patch 9.1.1005: completion text is highlighted even with no pattern found
Problem: completion text is highlighted even with no pattern found
Solution: use ins_compl_leader_len() instead of checking
compl_leader.length (glepnir)
closes: #16422
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/insexpand.c b/src/insexpand.c
index 22f021d..4a02f0e 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -927,7 +927,7 @@
if ((get_cot_flags() & COT_FUZZY))
return -1;
- if (col >= (compl_col + (int)compl_leader.length) && col < compl_ins_end_col)
+ if (col >= (compl_col + (int)ins_compl_leader_len()) && col < compl_ins_end_col)
return syn_name2attr((char_u *)"ComplMatchIns");
return -1;