changeset 30847:2c03ff81cbcb v9.0.0758

patch 9.0.0758: "precedes" from 'listchars' overwritten by <<< Commit: https://github.com/vim/vim/commit/13cdde39520220bb856cba16626327c706752b51 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 15 14:07:48 2022 +0100 patch 9.0.0758: "precedes" from 'listchars' overwritten by <<< Problem: "precedes" from 'listchars' overwritten by <<< for 'smoothscroll'. Solution: Keep the "precedes" character.
author Bram Moolenaar <Bram@vim.org>
date Sat, 15 Oct 2022 15:15:03 +0200
parents 0008e4e58ac0
children 43c9aef1234c
files src/drawline.c src/testdir/dumps/Test_smooth_list_1.dump src/testdir/dumps/Test_smooth_list_2.dump src/testdir/test_scroll_opt.vim src/version.c
diffstat 5 files changed, 46 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -766,9 +766,11 @@ wlv_screen_line(win_T *wp, winlinevars_T
 {
     if (wlv->row == 0 && wp->w_skipcol > 0
 #if defined(FEAT_LINEBREAK)
+	    // do not overwrite the 'showbreak' text with "<<<"
 	    && *get_showbreak_value(wp) == NUL
 #endif
-	    )
+	    // do not overwrite the 'listchars' "precedes" text with "<<<"
+	    && !(wp->w_p_list && wp->w_lcs_chars.prec != 0))
     {
 	int off = (int)(current_ScreenLine - ScreenLines);
 	int skip = 0;
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_list_1.dump
@@ -0,0 +1,8 @@
+|<+0#4040ff13#ffffff0@2|t+0#0000000&| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| 
+>l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| 
+|v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| 
+|t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |$+0#4040ff13&| +0#0000000&@18
+|t|h|r|e@1|$+0#4040ff13&| +0#0000000&@33
+|~+0#4040ff13&| @38
+|~| @38
+| +0#0000000&@21|2|,|8|1| @9|B|o|t| 
new file mode 100644
--- /dev/null
+++ b/src/testdir/dumps/Test_smooth_list_2.dump
@@ -0,0 +1,8 @@
+|#+0#4040ff13#ffffff0|e+0#0000000&|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| 
+>l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| 
+|v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| 
+|t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |$+0#4040ff13&| +0#0000000&@18
+|t|h|r|e@1|$+0#4040ff13&| +0#0000000&@33
+|~+0#4040ff13&| @38
+|~| @38
+|:+0#0000000&|s|e|t| |l|i|s|t|c|h|a|r|s|+|=|p|r|e|c|e|d|2|,|8|1| @9|B|o|t| 
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -155,6 +155,31 @@ func Test_smoothscroll_number()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_smoothscroll_list()
+  CheckScreendump
+
+  let lines =<< trim END
+      vim9script
+      set smoothscroll scrolloff=0
+      set list
+      setline(1, [
+        'one',
+        'very long text '->repeat(12),
+        'three',
+      ])
+      exe "normal 2Gzt\<C-E>"
+  END
+  call writefile(lines, 'XSmoothList', 'D')
+  let buf = RunVimInTerminal('-S XSmoothList', #{rows: 8, cols: 40})
+
+  call VerifyScreenDump(buf, 'Test_smooth_list_1', {})
+
+  call term_sendkeys(buf, ":set listchars+=precedes:#\<CR>")
+  call VerifyScreenDump(buf, 'Test_smooth_list_2', {})
+
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_smoothscroll_diff_mode()
   CheckScreendump
 
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    758,
+/**/
     757,
 /**/
     756,