patch 9.0.0214: splitting a line may duplicate virtual text
Problem: Splitting a line may duplicate virtual text. (Ben Jackson)
Solution: Don't duplicate a text property with virtual text. Make
auto-indenting work better. (closes #10919)
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index c380210..496e738 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2943,13 +2943,17 @@
let lines =<< trim END
vim9script
- setline(1, 'text one text two')
+ setline(1, ['text one text two', '', 'function(arg)'])
prop_type_add('propincl', {highlight: 'NonText', start_incl: true})
prop_add(1, 6, {type: 'propincl', text: 'after '})
cursor(1, 6)
prop_type_add('propnotincl', {highlight: 'NonText', start_incl: false})
prop_add(1, 15, {type: 'propnotincl', text: 'before '})
+
+ set cindent sw=4
+ prop_type_add('argname', {highlight: 'DiffChange', start_incl: true})
+ prop_add(3, 10, {type: 'argname', text: 'arg: '})
END
call writefile(lines, 'XscriptPropsStartIncl')
let buf = RunVimInTerminal('-S XscriptPropsStartIncl', #{rows: 8, cols: 60})
@@ -2965,6 +2969,13 @@
call term_sendkeys(buf, "yy\<Esc>")
call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_5', {})
+ call term_sendkeys(buf, "3Gfai\<CR>\<Esc>")
+ call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_6', {})
+ call term_sendkeys(buf, ">>")
+ call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_7', {})
+ call term_sendkeys(buf, "<<<<")
+ call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_8', {})
+
call StopVimInTerminal(buf)
call delete('XscriptPropsStartIncl')
endfunc