Skip to content

Commit 6f47c47

Browse files
brammooldouglaskayama
authored andcommitted
patch 7.4.746 Problem: ":[count]tag" is not always working. (cs86661) Solution: Set cur_match a bit later. (Hirohito Higashi)
1 parent 5fbd36a commit 6f47c47

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/tag.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,7 @@ do_tag(tag, type, count, forceit, verbose)
508508
tagmatchname = vim_strsave(name);
509509
}
510510

511-
/*
512-
* If a count is supplied to the ":tag <name>" command, then
513-
* jump to count'th matching tag.
514-
*/
515-
if (type == DT_TAG && *tag != NUL && count > 0)
516-
cur_match = count - 1;
517-
518-
if (type == DT_SELECT || type == DT_JUMP
511+
if (type == DT_TAG || type == DT_SELECT || type == DT_JUMP
519512
#if defined(FEAT_QUICKFIX)
520513
|| type == DT_LTAG
521514
#endif
@@ -594,7 +587,13 @@ do_tag(tag, type, count, forceit, verbose)
594587
}
595588
else
596589
#endif
597-
if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
590+
if (type == DT_TAG)
591+
/*
592+
* If a count is supplied to the ":tag <name>" command, then
593+
* jump to count'th matching tag.
594+
*/
595+
cur_match = count > 0 ? count - 1 : 0;
596+
else if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
598597
{
599598
/*
600599
* List all the matching tags.
@@ -990,7 +989,7 @@ do_tag(tag, type, count, forceit, verbose)
990989

991990

992991
ic = (matches[cur_match][0] & MT_IC_OFF);
993-
if (type != DT_SELECT && type != DT_JUMP
992+
if (type != DT_TAG && type != DT_SELECT && type != DT_JUMP
994993
#ifdef FEAT_CSCOPE
995994
&& type != DT_CSCOPE
996995
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ static char *(features[]) =
756756

757757
static int included_patches[] =
758758
{ /* Add new patch number below this line */
759+
/**/
760+
746,
759761
/**/
760762
745,
761763
/**/

0 commit comments

Comments
 (0)