summaryrefslogtreecommitdiff
path: root/src/testdir/test_textprop.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-04 18:07:24 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-04 18:07:24 +0100
commit21b5038e02306ce2fd438249055eed372befe51f (patch)
tree6d84ecc6531ca6c594ab9310a2cd45cbcee21b91 /src/testdir/test_textprop.vim
parent7f1664e392388fd38c8b154389167ad1bdedff66 (diff)
downloadvim-git-21b5038e02306ce2fd438249055eed372befe51f.tar.gz
patch 8.1.0690: setline() and setbufline() do not clear text propertiesv8.1.0690
Problem: setline() and setbufline() do not clear text properties. Solution: Clear text properties when setting the text.
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r--src/testdir/test_textprop.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index ac9967e94..d5069d4a7 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -261,6 +261,35 @@ func Test_prop_clear_buf()
bwipe!
endfunc
+func Test_prop_setline()
+ new
+ call AddPropTypes()
+ call SetupPropsInFirstLine()
+ call assert_equal(s:expected_props, prop_list(1))
+
+ call setline(1, 'foobar')
+ call assert_equal([], prop_list(1))
+
+ call DeletePropTypes()
+ bwipe!
+endfunc
+
+func Test_prop_setbufline()
+ new
+ call AddPropTypes()
+ call SetupPropsInFirstLine()
+ let bufnr = bufnr('')
+ wincmd w
+ call assert_equal(s:expected_props, prop_list(1, {'bufnr': bufnr}))
+
+ call setbufline(bufnr, 1, 'foobar')
+ call assert_equal([], prop_list(1, {'bufnr': bufnr}))
+
+ wincmd w
+ call DeletePropTypes()
+ bwipe!
+endfunc
+
" Setup a three line prop in lines 2 - 4.
" Add short props in line 1 and 5.
func Setup_three_line_prop()