comparison src/testdir/test_textprop.vim @ 16714:ba592f30c082 v8.1.1359

patch 8.1.1359: text property wrong after :substitute with backslash commit https://github.com/vim/vim/commit/f3333b02f34526da46cdae608f7e2d869bb8c654 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 19 22:53:40 2019 +0200 patch 8.1.1359: text property wrong after :substitute with backslash Problem: Text property wrong after :substitute with backslash. Solution: Adjust text property columns when removing backslashes. (closes #4397)
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 May 2019 23:00:05 +0200
parents 23af483c4ceb
children 09c81f17f83c
comparison
equal deleted inserted replaced
16713:ba3f15a7e5c9 16714:ba592f30c082
618 let expected[0].col = 9 618 let expected[0].col = 9
619 call assert_equal(expected, prop_list(1)) 619 call assert_equal(expected, prop_list(1))
620 undo 620 undo
621 let expected[0].col = 12 621 let expected[0].col = 12
622 call assert_equal(expected, prop_list(1)) 622 call assert_equal(expected, prop_list(1))
623 call prop_clear(1)
624
625 " substitute with backslash
626 call setline(1, 'the number 123 is highlighted.')
627 call prop_add(1, 12, {'length': 3, 'type': 'comment'})
628 let expected = [{'col': 12, 'length': 3, 'id': 0, 'type': 'comment', 'start': 1, 'end': 1} ]
629 call assert_equal(expected, prop_list(1))
630 1s/the/\The
631 call assert_equal(expected, prop_list(1))
632 1s/^/\\
633 let expected[0].col += 1
634 call assert_equal(expected, prop_list(1))
635 1s/^/\~
636 let expected[0].col += 1
637 call assert_equal(expected, prop_list(1))
638 1s/123/12\\3
639 let expected[0].length += 1
640 call assert_equal(expected, prop_list(1))
641 call prop_clear(1)
623 642
624 bwipe! 643 bwipe!
625 call prop_type_delete('comment') 644 call prop_type_delete('comment')
626 endfunc 645 endfunc
627 646