Mercurial > vim
diff src/testdir/test_textprop.vim @ 16698:23af483c4ceb v8.1.1351
patch 8.1.1351: text property wrong after :substitute
commit https://github.com/vim/vim/commit/338dfdad3844ebb1ce1d56c421d1f698c086eb0c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 19 15:19:57 2019 +0200
patch 8.1.1351: text property wrong after :substitute
Problem: Text property wrong after :substitute.
Solution: Save for undo before changing any text properties.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 19 May 2019 15:30:07 +0200 |
parents | 7847d281cbbf |
children | ba592f30c082 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -608,6 +608,19 @@ func Test_prop_undo() let expected[0].length = 2 call assert_equal(expected, prop_list(1)) + " substitute a word, then undo + call setline(1, 'the number 123 is highlighted.') + call prop_add(1, 12, {'length': 3, 'type': 'comment'}) + let expected = [{'col': 12, 'length': 3, 'id': 0, 'type': 'comment', 'start': 1, 'end': 1} ] + call assert_equal(expected, prop_list(1)) + set ul& + 1s/number/foo + let expected[0].col = 9 + call assert_equal(expected, prop_list(1)) + undo + let expected[0].col = 12 + call assert_equal(expected, prop_list(1)) + bwipe! call prop_type_delete('comment') endfunc