diff src/testdir/test_textprop.vim @ 29748:7e2321707fea v9.0.0214

patch 9.0.0214: splitting a line may duplicate virtual text Commit: https://github.com/vim/vim/commit/d8d4cfcb393123fa19640be0806091d47935407f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 15 15:55:10 2022 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 15 Aug 2022 17:00:06 +0200
parents b167c91b5f6b
children d08aa1bfe319
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2943,13 +2943,17 @@ func Test_insert_text_start_incl()
 
   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 @@ func Test_insert_text_start_incl()
   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