Mercurial > vim
diff src/testdir/test_textprop.vim @ 22037:35c8996a798e v8.2.1568
patch 8.2.1568: prop_find() skips properties in the same line
Commit: https://github.com/vim/vim/commit/4da7a259f6b28a4f855a6fa7d0ede5e038600154
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 2 19:59:00 2020 +0200
patch 8.2.1568: prop_find() skips properties in the same line
Problem: prop_find() skips properties in the same line if "skipstart" is
used.
Solution: Use "continue" instead of "break". (closes #6840)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 02 Sep 2020 20:00:05 +0200 |
parents | cbc570e66d11 |
children | 87502e318c19 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -211,6 +211,22 @@ func Test_prop_find() call prop_clear(1,6) call prop_type_delete('prop_name') + + " Multiple props per line, start on the first, should find the second. + let expected = {'lnum': 1, 'id': 0, 'col': 14, 'end': 1, 'type': 'misspell', 'length': 2, 'start': 1} + eval ['the quikc bronw fox jumsp over the layz dog']->repeat(2)->setline(1) + call prop_type_add('misspell', #{highlight: 'ErrorMsg'}) + for lnum in [1, 2] + for col in [8, 14, 24, 38] + call prop_add(lnum, col, #{type: 'misspell', length: 2}) + endfor + endfor + call cursor(1, 8) + let result = prop_find(#{type: 'misspell', skipstart: 1}, 'f') + call assert_equal(expected, result) + + call prop_type_delete('misspell') + bwipe! endfunc func Test_prop_find_smaller_len_than_match_col()