summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2015-06-19 16:45:43 +0200
committerBram Moolenaar <bram@vim.org>2015-06-19 16:45:43 +0200
commite333517bc2b4c8cfbb0a2a498da90299fc20c1d6 (patch)
treefef9899bf58a6ca5adf63a72b4c5be7c8f896292
parentd00cc5685944dae55e359272fb4299a48cb13252 (diff)
downloadvim-e333517bc2b4c8cfbb0a2a498da90299fc20c1d6.tar.gz
patch 7.4.746v7.4.746v7-4-746
Problem: ":[count]tag" is not always working. (cs86661) Solution: Set cur_match a bit later. (Hirohito Higashi)
-rw-r--r--src/tag.c19
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 10 deletions
diff --git a/src/tag.c b/src/tag.c
index ba42f158..8aaa86b9 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -508,14 +508,7 @@ do_tag(tag, type, count, forceit, verbose)
tagmatchname = vim_strsave(name);
}
- /*
- * If a count is supplied to the ":tag <name>" command, then
- * jump to count'th matching tag.
- */
- if (type == DT_TAG && *tag != NUL && count > 0)
- cur_match = count - 1;
-
- if (type == DT_SELECT || type == DT_JUMP
+ if (type == DT_TAG || type == DT_SELECT || type == DT_JUMP
#if defined(FEAT_QUICKFIX)
|| type == DT_LTAG
#endif
@@ -594,7 +587,13 @@ do_tag(tag, type, count, forceit, verbose)
}
else
#endif
- if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
+ if (type == DT_TAG)
+ /*
+ * If a count is supplied to the ":tag <name>" command, then
+ * jump to count'th matching tag.
+ */
+ cur_match = count > 0 ? count - 1 : 0;
+ else if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
{
/*
* List all the matching tags.
@@ -990,7 +989,7 @@ do_tag(tag, type, count, forceit, verbose)
ic = (matches[cur_match][0] & MT_IC_OFF);
- if (type != DT_SELECT && type != DT_JUMP
+ if (type != DT_TAG && type != DT_SELECT && type != DT_JUMP
#ifdef FEAT_CSCOPE
&& type != DT_CSCOPE
#endif
diff --git a/src/version.c b/src/version.c
index b5e88554..ed442034 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 746,
+/**/
745,
/**/
744,