1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2022-12-06 14:17:57 +00:00
parent 7155fb6614
commit 56a40fea9c
21 changed files with 229 additions and 40 deletions

View File

@@ -0,0 +1,8 @@
>"+0&#ffffff0| |l|i|n|e| |1| @51
|"| |l|i|n|e| |2| @51
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| +0&#ffffff0@47
|"| |l|i|n|e| |3| @51
|"| |l|i|n|e| |4| @51
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|@+0#4040ff13&@2| @56
| +0#0000000&@41|1|,|1| @10|T|o|p|

View File

@@ -0,0 +1,8 @@
|"+0&#ffffff0| |l|i|n|e| |7| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|"| |l|i|n|e| |8| @51
>"| |l|i|n|e| |9| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|"| |l|i|n|e| |1|0| @50
@42|9|,|1| @10|B|o|t|

View File

@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|e+0#0000000#ffd7ff255|r|t| |b|e|l|o|w| +0&#ffffff0@47
|"| |l|i|n|e| |8| @51
>"| |l|i|n|e| |9| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|"| |l|i|n|e| |1|0| @50
|~+0#4040ff13&| @58
| +0#0000000&@41|9|,|1| @10|B|o|t|

View File

@@ -0,0 +1,8 @@
|"+0&#ffffff0| |l|i|n|e| |8| @51
|"| |l|i|n|e| |9| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
>"| |l|i|n|e| |1|0| @50
|~+0#4040ff13&| @58
|~| @58
| +0#0000000&@41|1|0|,|1| @9|B|o|t|

View File

@@ -0,0 +1,8 @@
|"+0&#ffffff0| |l|i|n|e| |9| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
>"| |l|i|n|e| |1|0| @50
|~+0#4040ff13&| @58
|~| @58
|~| @58
| +0#0000000&@41|1|0|,|1| @9|B|o|t|

View File

@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|e+0#0000000#ffd7ff255|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
>"| |l|i|n|e| |1|0| @50
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
| +0#0000000&@41|1|0|,|1| @9|B|o|t|

View File

@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2| +0#0000000&@2|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@39
>"| |l|i|n|e| |1|0| @50
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|~| @58
| +0#0000000&@41|1|0|,|1| @9|B|o|t|

View File

@@ -0,0 +1,8 @@
>"+0&#ffffff0| |l|i|n|e| |1|0| @50
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
| +0#0000000&@41|1|0|,|1| @9|B|o|t|

View File

@@ -0,0 +1,8 @@
|"+0&#ffffff0| |l|i|n|e| |2| @51
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| +0&#ffffff0@47
|"| |l|i|n|e| |3| @51
>"| |l|i|n|e| |4| @51
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|"| |l|i|n|e| |5| @51
@42|4|,|1| @10|1|6|%|

View File

@@ -0,0 +1,8 @@
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| +0&#ffffff0@47
|"| |l|i|n|e| |3| @51
>"| |l|i|n|e| |4| @51
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|"| |l|i|n|e| |5| @51
|"| |l|i|n|e| |6| @51
@42|4|,|1| @10|3@1|%|

View File

@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|i+0#0000000&|n|e| |3| @51
>"| |l|i|n|e| |4| @51
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|"| |l|i|n|e| |5| @51
|"| |l|i|n|e| |6| @51
|@+0#4040ff13&@2| @56
| +0#0000000&@41|4|,|1| @10|3@1|%|

View File

@@ -0,0 +1,8 @@
|"+0&#ffffff0| |l|i|n|e| |4| @51
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|"| |l|i|n|e| |5| @51
>"| |l|i|n|e| |6| @51
|"| |l|i|n|e| |7| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
@42|6|,|1| @10|5|0|%|

View File

@@ -0,0 +1,8 @@
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|"| |l|i|n|e| |5| @51
>"| |l|i|n|e| |6| @51
|"| |l|i|n|e| |7| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|"| |l|i|n|e| |8| @51
@42|6|,|1| @10|6@1|%|

View File

@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|e+0#0000000#ffd7ff255|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|"| |l|i|n|e| |5| @51
>"| |l|i|n|e| |6| @51
|"| |l|i|n|e| |7| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|"| |l|i|n|e| |8| @51
|@+0#4040ff13&@2| @56
| +0#0000000&@41|6|,|1| @10|6@1|%|

View File

@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|i+0#0000000&|n|e| |5| @51
>"| |l|i|n|e| |6| @51
|"| |l|i|n|e| |7| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|"| |l|i|n|e| |8| @51
|"| |l|i|n|e| |9| @51
|@+0#4040ff13&@2| @56
| +0#0000000&@41|6|,|1| @10|6@1|%|

View File

@@ -0,0 +1,8 @@
|"+0&#ffffff0| |l|i|n|e| |6| @51
|"| |l|i|n|e| |7| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
>"| |l|i|n|e| |8| @51
|"| |l|i|n|e| |9| @51
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
@42|8|,|1| @10|8|3|%|

View File

@@ -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