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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
#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
}
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
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1777,
/**/
1776,
/**/