patch 9.1.1777: Mouse click to open fold doesn't work with utf-8 "foldclose" 
chars

Commit: 
https://github.com/vim/vim/commit/8b5fe7d0901f2d89b3f49f392b4d73cd58b8cc9d
Author: zeertzjq <[email protected]>
Date:   Sat Sep 20 14:16:57 2025 +0000

    patch 9.1.1777: Mouse click to open fold doesn't work with utf-8 
"foldclose" chars
    
    Problem:  Mouse click to open fold doesn't work with utf-8 "foldclose"
              chars (Balki)
    Solution: Use ScreenLinesUC[off] if it is set (zeertzjq).
    
    fixes: #18344
    closes: #18349
    
    Signed-off-by: zeertzjq <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/mouse.c b/src/mouse.c
index 8789eedc3..1f657b1b0 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -2109,7 +2109,8 @@ retnomove:
 #ifdef FEAT_FOLDING
        // Remember the character under the mouse, it might be a '-' or '+' in
        // the fold column.
-       mouse_char = ScreenLines[off];
+       mouse_char = enc_utf8 && ScreenLinesUC[off] != 0
+                                      ? ScreenLinesUC[off] : ScreenLines[off];
 #endif
     }
 
diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim
index bc31cdafa..652a1bf8c 100644
--- a/src/testdir/test_termcodes.vim
+++ b/src/testdir/test_termcodes.vim
@@ -1068,7 +1068,7 @@ func Test_mouse_alt_leftclick()
   bw!
 endfunc
 
-func Test_xterm_mouse_click_in_fold_columns()
+func Run_test_xterm_mouse_click_in_fold_columns()
   new
   let save_mouse = &mouse
   let save_term = &term
@@ -1120,6 +1120,15 @@ func Test_xterm_mouse_click_in_fold_columns()
   bwipe!
 endfunc
 
+func Test_xterm_mouse_click_in_fold_columns()
+  call Run_test_xterm_mouse_click_in_fold_columns()
+  set fillchars+=foldclose:▶
+  call Run_test_xterm_mouse_click_in_fold_columns()
+  set fillchars-=foldclose:▶ fillchars+=foldclose:!
+  call Run_test_xterm_mouse_click_in_fold_columns()
+  set fillchars&
+endfunc
+
 " Left or right click in Ex command line sets position of the cursor.
 func Test_term_mouse_click_in_cmdline_to_set_pos()
   let save_mouse = &mouse
diff --git a/src/version.c b/src/version.c
index be217095a..80affcf8d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -724,6 +724,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1777,
 /**/
     1776,
 /**/

-- 
-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uzybE-000k3A-9p%40256bit.org.

Raspunde prin e-mail lui