aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tag.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-11-17 19:18:40 -0800
committerGitHub <noreply@github.com>2019-11-17 19:18:40 -0800
commitd547c8d9ad21234cb6484d87c1d6b8e44714c6db (patch)
tree53835423a312b8058d803985b196f60e927af84e /src/nvim/tag.c
parentaf53a0c0123338575dd59934449d7fe836835d1c (diff)
parent6ca3e6bfa9e0551b453af040ca283ec7eb756178 (diff)
downloadrneovim-d547c8d9ad21234cb6484d87c1d6b8e44714c6db.tar.gz
rneovim-d547c8d9ad21234cb6484d87c1d6b8e44714c6db.tar.bz2
rneovim-d547c8d9ad21234cb6484d87c1d6b8e44714c6db.zip
Merge #11414 from janlazo/vim-8.1.2312
vim-patch:8.1.{2312,2314,2317}
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r--src/nvim/tag.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index a3967c70b5..9e8c05fb1e 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -65,6 +65,7 @@ typedef struct tag_pointers {
char_u *tagkind_end; // end of tagkind
char_u *user_data; // user_data string
char_u *user_data_end; // end of user_data
+ linenr_T tagline; // "line:" value
} tagptrs_T;
/*
@@ -2545,6 +2546,7 @@ parse_match(
tagp->tagkind = NULL;
tagp->user_data = NULL;
+ tagp->tagline = 0;
tagp->command_end = NULL;
if (retval == OK) {
@@ -2564,6 +2566,8 @@ parse_match(
tagp->tagkind = p + 5;
} else if (STRNCMP(p, "user_data:", 10) == 0) {
tagp->user_data = p + 10;
+ } else if (STRNCMP(p, "line:", 5) == 0) {
+ tagp->tagline = atoi((char *)p + 5);
}
if (tagp->tagkind != NULL && tagp->user_data != NULL) {
break;
@@ -2811,7 +2815,13 @@ static int jumpto_tag(
p_ic = FALSE; /* don't ignore case now */
p_scs = FALSE;
save_lnum = curwin->w_cursor.lnum;
- curwin->w_cursor.lnum = 0; /* start search before first line */
+ if (tagp.tagline > 0) {
+ // start search before line from "line:" field
+ curwin->w_cursor.lnum = tagp.tagline - 1;
+ } else {
+ // start search before first line
+ curwin->w_cursor.lnum = 0;
+ }
if (do_search(NULL, pbuf[0], pbuf + 1, (long)1,
search_options, NULL)) {
retval = OK;