patch 9.0.0130: cursor position wrong when inserting around virtual text
Problem: Cursor position wrong when inserting around virtual text.
Solution: Update the cursor position properly.
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 5ac787e..2a74dc7 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2256,4 +2256,20 @@
bwipe!
endfunc
+def Test_insert_text_before_virtual_text()
+ new foobar
+ setline(1, '12345678')
+ prop_type_add('test', {highlight: 'Search'})
+ prop_add(1, 5, {
+ type: 'test',
+ text: ' virtual text '
+ })
+ normal! f4axyz
+ normal! f5iXYZ
+ assert_equal('1234xyzXYZ5678', getline(1))
+
+ prop_type_delete('test')
+ bwipe!
+enddef
+
" vim: shiftwidth=2 sts=2 expandtab