diff src/testdir/test_textprop.vim @ 31371:1c43d8bad31d v9.0.1019

patch 9.0.1019: 'smoothscroll' and virtual text above don't work together Commit: https://github.com/vim/vim/commit/56a40fea9c28f8fc918a0db6de4c048da241cf32 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 6 14:17:57 2022 +0000 patch 9.0.1019: 'smoothscroll' and virtual text above don't work together Problem: 'smoothscroll' and virtual text above don't work together. (Yee Cheng Chin) Solution: Skip virtual text above when w_skipcol is non-zero. (closes #11665)
author Bram Moolenaar <Bram@vim.org>
date Tue, 06 Dec 2022 15:30:04 +0100
parents a93392e93a53
children c097c18dcedb
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -3113,6 +3113,34 @@ func Test_prop_below_split_line()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_prop_above_below_smoothscroll()
+  CheckRunVimInTerminal
+
+  let lines =<< trim END
+      vim9script
+      setline(1, range(1, 10)->mapnew((_, v) => '" line ' .. v))
+
+      set smoothscroll wrap
+      call prop_type_add('mytype', {highlight: 'DiffChange'})
+      call prop_add(3, 0, {text: "insert above", type: "mytype", text_align: 'above'})
+      call prop_add(5, 0, {text: "insert above 1", type: "mytype", text_align: 'above'})
+      call prop_add(5, 0, {text: "insert above 2", type: "mytype", text_align: 'above'})
+      call prop_add(7, 0, {text: "insert below", type: "mytype", text_align: 'below'})
+      call prop_add(9, 0, {text: "insert below 1", type: "mytype", text_align: 'below'})
+      call prop_add(9, 0, {text: "insert below 2", type: "mytype", text_align: 'below'})
+  END
+  call writefile(lines, 'XscriptPropsSmoothscroll', 'D')
+  let buf = RunVimInTerminal('-S XscriptPropsSmoothscroll', #{rows: 8, cols: 60})
+  call VerifyScreenDump(buf, 'Test_prop_above_below_smoothscroll_1', {})
+
+  for nr in range(2, 16)
+    call term_sendkeys(buf, "\<C-E>")
+    call VerifyScreenDump(buf, 'Test_prop_above_below_smoothscroll_' .. nr, {})
+  endfor
+
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_props_with_text_override()
   CheckRunVimInTerminal