aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/tag.c2
-rw-r--r--src/nvim/testdir/test_tagjump.vim28
2 files changed, 29 insertions, 1 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 02dc36b57a..3b87fcb878 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -2223,7 +2223,7 @@ static size_t matching_line_len(const char_u *const lbuf)
const char_u *p = lbuf + 1;
// does the same thing as parse_match()
- p += STRLEN(p) + 2;
+ p += STRLEN(p) + 1;
return (p - lbuf) + STRLEN(p);
}
diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim
index 268a153077..f9bd8b5246 100644
--- a/src/nvim/testdir/test_tagjump.vim
+++ b/src/nvim/testdir/test_tagjump.vim
@@ -230,4 +230,32 @@ func Test_tag_file_encoding()
call delete('Xtags1')
endfunc
+func Test_tagjump_etags()
+ if !has('emacs_tags')
+ return
+ endif
+ call writefile([
+ \ "void foo() {}",
+ \ "int main(int argc, char **argv)",
+ \ "{",
+ \ "\tfoo();",
+ \ "\treturn 0;",
+ \ "}",
+ \ ], 'Xmain.c')
+
+ call writefile([
+ \ "\x0c",
+ \ "Xmain.c,64",
+ \ "void foo() {}\x7ffoo\x011,0",
+ \ "int main(int argc, char **argv)\x7fmain\x012,14",
+ \ ], 'Xtags')
+ set tags=Xtags
+ ta foo
+ call assert_equal('void foo() {}', getline('.'))
+
+ call delete('Xtags')
+ call delete('Xmain.c')
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab