aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2016-01-30 12:18:36 +0100
committerJurica Bradaric <jbradaric@gmail.com>2016-01-30 12:29:41 +0100
commit73234bfec6f9aa1741b30d19817284cd26392376 (patch)
tree5621591a20317bc00adca87c0537f95a20d07496
parentf8ad215d25e6bbaafbb309b9d844209b78eb6d48 (diff)
downloadrneovim-73234bfec6f9aa1741b30d19817284cd26392376.tar.gz
rneovim-73234bfec6f9aa1741b30d19817284cd26392376.tar.bz2
rneovim-73234bfec6f9aa1741b30d19817284cd26392376.zip
vim-patch:7.4.746
Problem: ":[count]tag" is not always working. (cs86661) Solution: Set cur_match a bit later. (Hirohito Higashi) https://github.com/vim/vim/commit/01cf376da1726862afc8fa1d84cf5a773909fd0d
-rw-r--r--src/nvim/tag.c22
-rw-r--r--src/nvim/version.c2
2 files changed, 10 insertions, 14 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index d832924efd..3d2c069530 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -445,17 +445,10 @@ do_tag (
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
- || type == DT_LTAG
- )
+ if (type == DT_TAG || type == DT_SELECT || type == DT_JUMP
+ || type == DT_LTAG) {
cur_match = MAXCOL - 1;
+ }
max_num_matches = cur_match + 1;
/* when the argument starts with '/', use it as a regexp */
@@ -511,8 +504,11 @@ do_tag (
if (type == DT_CSCOPE && num_matches > 1) {
cs_print_tags();
ask_for_selection = TRUE;
- } else if (type == DT_SELECT ||
- (type == DT_JUMP && num_matches > 1)) {
+ } else 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.
* Assume that the first match indicates how long the tags can
@@ -851,7 +847,7 @@ do_tag (
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
&& type != DT_CSCOPE
&& (num_matches > 1 || ic)
&& !skip_msg) {
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 33aa680ca3..bf26497679 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -388,7 +388,7 @@ static int included_patches[] = {
// 749,
// 748,
// 747,
- // 746,
+ 746,
745,
// 744 NA
// 743,