vim-patch:8.0.1488: emacs tags no longer work

Problem:    Emacs tags no longer work. (zdohnal)
Solution:   Do not skip over end of line.
0d20737732
This commit is contained in:
Jan Edmund Lazo
2018-08-14 11:22:42 -04:00
parent 5e38ff105c
commit 1daf2cb0ea
2 changed files with 29 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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