patch 9.1.0480: fuzzy string matching executed when not needed

Commit: 
https://github.com/vim/vim/commit/1c296026627d7ac8195e803b4c2393c21ae659b4
Author: glepnir <glephun...@gmail.com>
Date:   Thu Jun 13 17:21:24 2024 +0200

    patch 9.1.0480: fuzzy string matching executed when not needed
    
    Problem:  fuzzy string matching executed when not needed
    Solution: when no leader is available, can skip fuzzy logic, so return
              early (glepnir)
    
    closes: #14986
    
    Signed-off-by: glepnir <glephun...@gmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/popupmenu.c b/src/popupmenu.c
index dd1a6ec99..09ed57427 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -434,21 +434,22 @@ pum_screen_put_with_attr(int row, int col, char_u *text, 
int textlen, int attr)
     char_u     *leader = ins_compl_leader();
     int                in_fuzzy = (get_cot_flags() & COT_FUZZY) != 0;
 
-    if ((highlight_attr[HLF_PMSI] == highlight_attr[HLF_PSI] &&
-         highlight_attr[HLF_PMNI] == highlight_attr[HLF_PNI]))
+    if (leader == NULL || *leader == NUL ||
+           (highlight_attr[HLF_PMSI] == highlight_attr[HLF_PSI] &&
+                       highlight_attr[HLF_PMNI] == highlight_attr[HLF_PNI]))
     {
         screen_puts_len(text, textlen, row, col, attr);
         return;
     }
 
 #ifdef FEAT_RIGHTLEFT
-    if (leader != NULL && curwin->w_p_rl)
+    if (curwin->w_p_rl)
         rt_leader = reverse_text(leader);
 #endif
     match_leader = rt_leader != NULL ? rt_leader : leader;
-    leader_len = match_leader ? (int)STRLEN(match_leader) : 0;
+    leader_len = (int)STRLEN(match_leader);
 
-    if (match_leader != NULL && leader_len > 0 && in_fuzzy)
+    if (in_fuzzy)
         ga = fuzzy_match_str_with_pos(text, match_leader);
 
     // Render text with proper attributes
diff --git a/src/version.c b/src/version.c
index 5addf1a8d..89ba9fc39 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    480,
 /**/
     479,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1sHmOr-00AedX-Df%40256bit.org.

Raspunde prin e-mail lui