diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-08 13:21:11 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-03-08 13:21:11 +0100 |
commit | 4352d41db0d93ab9266c64be48eda872cb5ea589 (patch) | |
tree | a10aa3db77c6db9c7c809200569a9bdd15119f92 /src/nvim/tag.c | |
parent | 0355c1ed9c481d4ad3bf24887e0af869834e1b40 (diff) | |
parent | 96e2c3945f13453070894c70c74e4da29d421dab (diff) | |
download | rneovim-4352d41db0d93ab9266c64be48eda872cb5ea589.tar.gz rneovim-4352d41db0d93ab9266c64be48eda872cb5ea589.tar.bz2 rneovim-4352d41db0d93ab9266c64be48eda872cb5ea589.zip |
Merge #9662 'vim-patch:8.0.{0643-0646}'
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r-- | src/nvim/tag.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 75bad047ac..410b9dfcbd 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -2508,9 +2508,9 @@ static int jumpto_tag( save_lnum = curwin->w_cursor.lnum; curwin->w_cursor.lnum = 0; /* start search before first line */ if (do_search(NULL, pbuf[0], pbuf + 1, (long)1, - search_options, NULL)) + search_options, NULL, NULL)) { retval = OK; - else { + } else { int found = 1; int cc; @@ -2519,23 +2519,22 @@ static int jumpto_tag( */ p_ic = TRUE; if (!do_search(NULL, pbuf[0], pbuf + 1, (long)1, - search_options, NULL)) { - /* - * Failed to find pattern, take a guess: "^func (" - */ + search_options, NULL, NULL)) { + // Failed to find pattern, take a guess: "^func (" found = 2; (void)test_for_static(&tagp); cc = *tagp.tagname_end; *tagp.tagname_end = NUL; - sprintf((char *)pbuf, "^%s\\s\\*(", tagp.tagname); + snprintf((char *)pbuf, LSIZE, "^%s\\s\\*(", tagp.tagname); if (!do_search(NULL, '/', pbuf, (long)1, - search_options, NULL)) { - /* Guess again: "^char * \<func (" */ - sprintf((char *)pbuf, "^\\[#a-zA-Z_]\\.\\*\\<%s\\s\\*(", - tagp.tagname); + search_options, NULL, NULL)) { + // Guess again: "^char * \<func (" + snprintf((char *)pbuf, LSIZE, "^\\[#a-zA-Z_]\\.\\*\\<%s\\s\\*(", + tagp.tagname); if (!do_search(NULL, '/', pbuf, (long)1, - search_options, NULL)) + search_options, NULL, NULL)) { found = 0; + } } *tagp.tagname_end = cc; } |