1
0
forked from aniani/vim

patch 8.2.0378: prop_find() does not find all props

Problem:    prop_find() does not find all props.
Solution:   Check being in the start line. (Axel Forsman, closes #5776)
This commit is contained in:
Bram Moolenaar
2020-03-13 21:36:40 +01:00
parent d47e6f0b4c
commit 346f18e5fe
3 changed files with 21 additions and 7 deletions

View File

@@ -213,6 +213,17 @@ func Test_prop_find()
call prop_type_delete('prop_name')
endfunc
func Test_prop_find_smaller_len_than_match_col()
new
call prop_type_add('test', {'highlight': 'ErrorMsg'})
call setline(1, ['xxxx', 'x'])
call prop_add(1, 4, {'type': 'test'})
call assert_equal({'id': 0, 'lnum': 1, 'col': 4, 'type': 'test', 'length': 0, 'start': 1, 'end': 1},
\ prop_find({'type': 'test', 'lnum': 2, 'col': 1}, 'b'))
bwipe!
call prop_type_delete('test')
endfunc
func Test_prop_add()
new
call AddPropTypes()

View File

@@ -663,6 +663,7 @@ f_prop_find(typval_T *argvars, typval_T *rettv)
mch_memmove(&prop, text + textlen + i * sizeof(textprop_T),
sizeof(textprop_T));
if (lnum == lnum_start)
if (dir < 0)
{
if (col < prop.tp_col)

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
378,
/**/
377,
/**/