mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
vim-patch:9.1.0565: Stop directory doesn't work properly in 'tags'
Problem: Stop directory doesn't work properly in 'tags'. (Jesse Pavel) Solution: Also move the stop directory forward by one byte. (zeertzjq) This doesn't support relative stop directories yet, as they are not supported in other places like findfile() either. fixes: vim/vim#15200 related: vim/vim#1520268819afb2c
(cherry picked from commit50feb85b0c
)
This commit is contained in:
committed by
github-actions[bot]
parent
fde5718e62
commit
4ce293c2c3
@ -2582,6 +2582,10 @@ int get_tagfname(tagname_T *tnp, int first, char *buf)
|
||||
// move the filename one char forward and truncate the
|
||||
// filepath with a NUL
|
||||
filename = path_tail(buf);
|
||||
if (r_ptr != NULL) {
|
||||
STRMOVE(r_ptr + 1, r_ptr);
|
||||
r_ptr++;
|
||||
}
|
||||
STRMOVE(filename + 1, filename);
|
||||
*filename++ = NUL;
|
||||
|
||||
|
@ -135,6 +135,29 @@ func Test_tagsfile_without_trailing_newline()
|
||||
set tags&
|
||||
endfunc
|
||||
|
||||
" Check that specifying a stop directory in 'tags' works properly.
|
||||
func Test_tagfiles_stopdir()
|
||||
let save_cwd = getcwd()
|
||||
|
||||
call mkdir('Xtagsdir1/Xtagsdir2/Xtagsdir3', 'pR')
|
||||
call writefile([], 'Xtagsdir1/Xtags', 'D')
|
||||
|
||||
cd Xtagsdir1/
|
||||
let &tags = './Xtags;' .. fnamemodify('./..', ':p')
|
||||
call assert_equal(1, len(tagfiles()))
|
||||
|
||||
cd Xtagsdir2/
|
||||
let &tags = './Xtags;' .. fnamemodify('./..', ':p')
|
||||
call assert_equal(1, len(tagfiles()))
|
||||
|
||||
cd Xtagsdir3/
|
||||
let &tags = './Xtags;' .. fnamemodify('./..', ':p')
|
||||
call assert_equal(0, len(tagfiles()))
|
||||
|
||||
set tags&
|
||||
call chdir(save_cwd)
|
||||
endfunc
|
||||
|
||||
" Test for ignoring comments in a tags file
|
||||
func Test_tagfile_ignore_comments()
|
||||
call writefile([
|
||||
|
Reference in New Issue
Block a user