aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2019-04-01 01:38:55 +0200
committerMarco Hinz <mh.codebro@gmail.com>2019-04-02 22:20:53 +0200
commit2a73549ee8633afa817cc49fd691dc0ed3e67cf4 (patch)
treec7d288f2abe07eef4215b94edab6cad311827a50 /src
parent8eaa452073a1be59234642dba347316226f1dcb1 (diff)
downloadrneovim-2a73549ee8633afa817cc49fd691dc0ed3e67cf4.tar.gz
rneovim-2a73549ee8633afa817cc49fd691dc0ed3e67cf4.tar.bz2
rneovim-2a73549ee8633afa817cc49fd691dc0ed3e67cf4.zip
vim-patch:8.1.1093: support for outdated tags format slows down tag parsing
Problem: Support for outdated tags format slows down tag parsing. Solution: Remove FEAT_TAG_OLDSTATIC. https://github.com/vim/vim/commit/96428dd4e961332e97d86013a321cedf5fafbed6
Diffstat (limited to 'src')
-rw-r--r--src/nvim/tag.c62
1 files changed, 9 insertions, 53 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index c609af4751..bc425ab6d4 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -1561,24 +1561,6 @@ parse_line:
}
/*
- * Check for old style static tag: "file:tag file .."
- */
- tagp.fname = NULL;
- for (p = lbuf; p < tagp.tagname_end; ++p) {
- if (*p == ':') {
- if (tagp.fname == NULL)
- tagp.fname = tagp.tagname_end + 1;
- if ( fnamencmp(lbuf, tagp.fname, p - lbuf) == 0
- && tagp.fname[p - lbuf] == TAB
- ) {
- /* found one */
- tagp.tagname = p + 1;
- break;
- }
- }
- }
-
- /*
* Skip this line if the length of the tag is different and
* there is no regexp, or the tag is too short.
*/
@@ -1677,11 +1659,8 @@ parse_line:
if (mb_strnicmp(tagp.tagname, orgpat.head, (size_t)cmplen) != 0)
continue;
- /*
- * Can be a matching tag, isolate the file name and command.
- */
- if (tagp.fname == NULL)
- tagp.fname = tagp.tagname_end + 1;
+ // Can be a matching tag, isolate the file name and command.
+ tagp.fname = tagp.tagname_end + 1;
tagp.fname_end = vim_strchr(tagp.fname, TAB);
tagp.command = tagp.fname_end + 1;
if (tagp.fname_end == NULL)
@@ -1748,19 +1727,12 @@ parse_line:
/* Don't change the ordering, always use the same table. */
mtt = MT_GL_OTH;
} else {
- /* Decide in which array to store this match. */
- is_current = test_for_current(
- tagp.fname, tagp.fname_end, tag_fname,
- buf_ffname);
- {
- if (tagp.tagname != lbuf)
- is_static = TRUE; /* detected static tag before */
- else
- is_static = test_for_static(&tagp);
- }
+ // Decide in which array to store this match.
+ is_current = test_for_current(tagp.fname, tagp.fname_end, tag_fname,
+ buf_ffname);
+ is_static = test_for_static(&tagp);
- /* decide in which of the sixteen tables to store this
- * match */
+ // Decide in which of the sixteen tables to store this match.
if (is_static) {
if (is_current)
mtt = MT_ST_CUR;
@@ -2192,25 +2164,9 @@ parse_tag_line (
*/
static bool test_for_static(tagptrs_T *tagp)
{
- char_u *p;
-
- int len;
+ char_u *p;
- /*
- * Check for old style static tag: "file:tag file .."
- */
- len = (int)(tagp->fname_end - tagp->fname);
- p = tagp->tagname + len;
- if ( p < tagp->tagname_end
- && *p == ':'
- && fnamencmp(tagp->tagname, tagp->fname, len) == 0) {
- tagp->tagname = p + 1;
- return TRUE;
- }
-
- /*
- * Check for new style static tag ":...<Tab>file:[<Tab>...]"
- */
+ // Check for new style static tag ":...<Tab>file:[<Tab>...]"
p = tagp->command;
while ((p = vim_strchr(p, '\t')) != NULL) {
++p;