Patch 8.2.0365

10 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 9, 2020, 3:20:23 AM3/9/20
to vim...@googlegroups.com

Patch 8.2.0365
Problem: Tag kind can't be a multi-byte character. (Marcin Szamotulski)
Solution: Recognize multi-byte character. (closes #5724)
Files: src/tag.c, src/testdir/test_taglist.vim


*** ../vim-8.2.0364/src/tag.c 2020-02-21 21:30:33.871979710 +0100
--- src/tag.c 2020-03-09 08:16:10.211037983 +0100
***************
*** 3229,3235 ****
tagp->command_end = p;
p += 2; // skip ";\""
if (*p++ == TAB)
! while (ASCII_ISALPHA(*p))
{
if (STRNCMP(p, "kind:", 5) == 0)
tagp->tagkind = p + 5;
--- 3229,3237 ----
tagp->command_end = p;
p += 2; // skip ";\""
if (*p++ == TAB)
! // Accept ASCII alphabetic kind characters and any multi-byte
! // character.
! while (ASCII_ISALPHA(*p) || mb_ptr2len(p) > 1)
{
if (STRNCMP(p, "kind:", 5) == 0)
tagp->tagkind = p + 5;
***************
*** 3245,3264 ****
tagp->tagkind = p;
if (pt == NULL)
break;
! p = pt + 1;
}
}
if (tagp->tagkind != NULL)
{
for (p = tagp->tagkind;
! *p && *p != '\t' && *p != '\r' && *p != '\n'; ++p)
;
tagp->tagkind_end = p;
}
if (tagp->user_data != NULL)
{
for (p = tagp->user_data;
! *p && *p != '\t' && *p != '\r' && *p != '\n'; ++p)
;
tagp->user_data_end = p;
}
--- 3247,3267 ----
tagp->tagkind = p;
if (pt == NULL)
break;
! p = pt;
! MB_PTR_ADV(p);
}
}
if (tagp->tagkind != NULL)
{
for (p = tagp->tagkind;
! *p && *p != '\t' && *p != '\r' && *p != '\n'; MB_PTR_ADV(p))
;
tagp->tagkind_end = p;
}
if (tagp->user_data != NULL)
{
for (p = tagp->user_data;
! *p && *p != '\t' && *p != '\r' && *p != '\n'; MB_PTR_ADV(p))
;
tagp->user_data_end = p;
}
***************
*** 4006,4012 ****
if (tp.command_end != NULL)
{
for (p = tp.command_end + 3;
! *p != NUL && *p != '\n' && *p != '\r'; ++p)
{
if (p == tp.tagkind || (p + 5 == tp.tagkind
&& STRNCMP(p, "kind:", 5) == 0))
--- 4009,4015 ----
if (tp.command_end != NULL)
{
for (p = tp.command_end + 3;
! *p != NUL && *p != '\n' && *p != '\r'; MB_PTR_ADV(p))
{
if (p == tp.tagkind || (p + 5 == tp.tagkind
&& STRNCMP(p, "kind:", 5) == 0))
*** ../vim-8.2.0364/src/testdir/test_taglist.vim 2020-01-05 20:35:39.967830421 +0100
--- src/testdir/test_taglist.vim 2020-03-09 08:09:19.729331351 +0100
***************
*** 7,12 ****
--- 7,13 ----
\ "BFoo\tXbar\t1",
\ "BBar\tXbar\t2",
\ "Kindly\tXbar\t3;\"\tv\tfile:",
+ \ "Lambda\tXbar\t3;\"\tλ\tfile:",
\ "Command\tXbar\tcall cursor(3, 4)|;\"\td",
\ ], 'Xtags')
set tags=Xtags
***************
*** 17,28 ****
call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo", "Xfoo"), {i, v -> v.name}))
call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name}))

! let kind = taglist("Kindly")
! call assert_equal(1, len(kind))
! call assert_equal('v', kind[0]['kind'])
! call assert_equal('3', kind[0]['cmd'])
! call assert_equal(1, kind[0]['static'])
! call assert_equal('Xbar', kind[0]['filename'])

let cmd = taglist("Command")
call assert_equal(1, len(cmd))
--- 18,33 ----
call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo", "Xfoo"), {i, v -> v.name}))
call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name}))

! let kindly = taglist("Kindly")
! call assert_equal(1, len(kindly))
! call assert_equal('v', kindly[0]['kind'])
! call assert_equal('3', kindly[0]['cmd'])
! call assert_equal(1, kindly[0]['static'])
! call assert_equal('Xbar', kindly[0]['filename'])
!
! let lambda = taglist("Lambda")
! call assert_equal(1, len(lambda))
! call assert_equal('λ', lambda[0]['kind'])

let cmd = taglist("Command")
call assert_equal(1, len(cmd))
*** ../vim-8.2.0364/src/version.c 2020-03-08 18:41:03.407429568 +0100
--- src/version.c 2020-03-09 08:16:54.826781046 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 365,
/**/

--
Some of the well known MS-Windows errors:
ESLEEP Operator fell asleep
ENOERR No error yet
EDOLLAR OS too expensive
EWINDOWS MS-Windows loaded, system in danger

/// 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