diff options
author | Ashkan Kiani <ashkan.k.kiani@gmail.com> | 2019-11-21 10:04:32 -0800 |
---|---|---|
committer | Ashkan Kiani <ashkan.k.kiani@gmail.com> | 2019-11-21 10:04:32 -0800 |
commit | 6a5140137865025dee68e75a4e8feb2d20a430cf (patch) | |
tree | bd9815ea488c4ee77bdfd6631ba7159f039ebe3e /src/nvim/tag.c | |
parent | b7170f2d722cee24a62eb74ac836d6192e5475dc (diff) | |
parent | cc5487e32f6fc6d0034634a1f9e736968afb4450 (diff) | |
download | rneovim-6a5140137865025dee68e75a4e8feb2d20a430cf.tar.gz rneovim-6a5140137865025dee68e75a4e8feb2d20a430cf.tar.bz2 rneovim-6a5140137865025dee68e75a4e8feb2d20a430cf.zip |
Merge remote-tracking branch 'origin/master' into lsp-followup
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r-- | src/nvim/tag.c | 12 |
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; |