summaryrefslogtreecommitdiff
path: root/src/testdir/test_textprop.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-15 20:34:10 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-15 20:34:10 +0200
commitc8f12c9856df58c760fe54d81b2ec5ed4dcaffd6 (patch)
treeb0449446172778dd7b2930e7c2e14ac507d3a843 /src/testdir/test_textprop.vim
parent9b123d859053ad1fb91d38334726b9f24da39930 (diff)
downloadvim-git-c8f12c9856df58c760fe54d81b2ec5ed4dcaffd6.tar.gz
patch 8.2.1688: increment/decrement removes text propertyv8.2.1688
Problem: Increment/decrement removes text property. Solution: Insert the new number before deleting the old one. (closes #6962)
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r--src/testdir/test_textprop.vim22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index ff7102f6a..ae84cf974 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1273,7 +1273,7 @@ func Test_prop_func_invalid_args()
call assert_fails("call prop_type_list([])", 'E715:')
endfunc
-func Test_split_join()
+func Test_prop_split_join()
new
call prop_type_add('test', {'highlight': 'ErrorMsg'})
call setline(1, 'just some text')
@@ -1294,4 +1294,24 @@ func Test_split_join()
call prop_type_delete('test')
endfunc
+func Test_prop_increment_decrement()
+ new
+ call prop_type_add('test', {'highlight': 'ErrorMsg'})
+ call setline(1, 'its 998 times')
+ call prop_add(1, 5, {'length': 3, 'type': 'test'})
+
+ exe "normal! 0f9\<C-A>"
+ eval getline(1)->assert_equal('its 999 times')
+ eval prop_list(1)->assert_equal([
+ \ #{id: 0, col: 5, end: 1, type: 'test', length: 3, start: 1}])
+
+ exe "normal! 0f9\<C-A>"
+ eval getline(1)->assert_equal('its 1000 times')
+ eval prop_list(1)->assert_equal([
+ \ #{id: 0, col: 5, end: 1, type: 'test', length: 4, start: 1}])
+
+ bwipe!
+ call prop_type_delete('test')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab