Patch 8.2.0378

8 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 13, 2020, 4:38:22 PM3/13/20
to vim...@googlegroups.com

Patch 8.2.0378
Problem: prop_find() does not find all props.
Solution: Check being in the start line. (Axel Forsman, closes #5776)
Files: src/textprop.c, src/testdir/test_textprop.vim


*** ../vim-8.2.0377/src/textprop.c 2020-03-11 19:15:37.641342464 +0100
--- src/textprop.c 2020-03-13 21:31:54.913754876 +0100
***************
*** 663,675 ****
mch_memmove(&prop, text + textlen + i * sizeof(textprop_T),
sizeof(textprop_T));

! if (dir < 0)
! {
! if (col < prop.tp_col)
! break;
! }
! else if (prop.tp_col + prop.tp_len - (prop.tp_len != 0) < col)
! continue;

if (prop.tp_id == id || prop.tp_type == type_id)
{
--- 663,676 ----
mch_memmove(&prop, text + textlen + i * sizeof(textprop_T),
sizeof(textprop_T));

! if (lnum == lnum_start)
! if (dir < 0)
! {
! if (col < prop.tp_col)
! break;
! }
! else if (prop.tp_col + prop.tp_len - (prop.tp_len != 0) < col)
! continue;

if (prop.tp_id == id || prop.tp_type == type_id)
{
*** ../vim-8.2.0377/src/testdir/test_textprop.vim 2020-03-11 19:15:37.641342464 +0100
--- src/testdir/test_textprop.vim 2020-03-13 21:26:45.239085936 +0100
***************
*** 213,218 ****
--- 213,229 ----
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()
*** ../vim-8.2.0377/src/version.c 2020-03-13 15:08:21.423872577 +0100
--- src/version.c 2020-03-13 21:30:50.602025742 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 378,
/**/

--
hundred-and-one symptoms of being an internet addict:
251. You've never seen your closest friends who usually live WAY too far away.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages