Skip to content

Commit 0d20737

Browse files
committed
patch 8.0.1488: emacs tags no longer work
Problem: Emacs tags no longer work. (zdohnal) Solution: Do not skip over end of line.
1 parent 8846ac5 commit 0d20737

3 files changed

Lines changed: 32 additions & 5 deletions

File tree

src/tag.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,12 +2958,9 @@ matching_line_len(char_u *lbuf)
29582958
char_u *p = lbuf + 1;
29592959

29602960
/* does the same thing as parse_match() */
2961-
p += STRLEN(p) + 2;
2961+
p += STRLEN(p) + 1;
29622962
#ifdef FEAT_EMACS_TAGS
2963-
if (*p)
2964-
p += STRLEN(p);
2965-
else
2966-
++p;
2963+
p += STRLEN(p) + 1;
29672964
#endif
29682965
return (p - lbuf) + STRLEN(p);
29692966
}

src/testdir/test_tagjump.vim

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,32 @@ func Test_tag_file_encoding()
229229
call delete('Xtags1')
230230
endfunc
231231

232+
func Test_tagjump_etags()
233+
if !has('emacs_tags')
234+
return
235+
endif
236+
call writefile([
237+
\ "void foo() {}",
238+
\ "int main(int argc, char **argv)",
239+
\ "{",
240+
\ "\tfoo();",
241+
\ "\treturn 0;",
242+
\ "}",
243+
\ ], 'Xmain.c')
244+
245+
call writefile([
246+
\ "\x0c",
247+
\ "Xmain.c,64",
248+
\ "void foo() {}\x7ffoo\x011,0",
249+
\ "int main(int argc, char **argv)\x7fmain\x012,14",
250+
\ ], 'Xtags')
251+
set tags=Xtags
252+
ta foo
253+
call assert_equal('void foo() {}', getline('.'))
254+
255+
call delete('Xtags')
256+
call delete('Xmain.c')
257+
bwipe!
258+
endfunc
259+
232260
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1488,
774776
/**/
775777
1487,
776778
/**/

0 commit comments

Comments
 (0)