mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.4553: linear tag search is a bit slow
Problem: Linear tag search is a bit slow.
Solution: Remove a vim_ftell() call. (Yegappan Lakshmanan, closes vim/vim#9937)
8b530b3158
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
parent
cf759c7429
commit
6a5fbabe48
@ -1609,7 +1609,6 @@ static tags_read_status_T findtags_get_next_line(findtags_state_T *st, tagsearch
|
|||||||
|
|
||||||
// skip empty and blank lines
|
// skip empty and blank lines
|
||||||
do {
|
do {
|
||||||
sinfo_p->curr_offset = vim_ftell(st->fp);
|
|
||||||
eof = vim_fgets((char_u *)st->lbuf, st->lbuf_size, st->fp);
|
eof = vim_fgets((char_u *)st->lbuf, st->lbuf_size, st->fp);
|
||||||
} while (!eof && vim_isblankline(st->lbuf));
|
} while (!eof && vim_isblankline(st->lbuf));
|
||||||
|
|
||||||
@ -2161,7 +2160,7 @@ line_read_in:
|
|||||||
xfree(st->lbuf);
|
xfree(st->lbuf);
|
||||||
st->lbuf = xmalloc((size_t)st->lbuf_size);
|
st->lbuf = xmalloc((size_t)st->lbuf_size);
|
||||||
|
|
||||||
if (st->state == TS_STEP_FORWARD) {
|
if (st->state == TS_STEP_FORWARD || st->state == TS_LINEAR) {
|
||||||
// Seek to the same position to read the same line again
|
// Seek to the same position to read the same line again
|
||||||
vim_ignored = vim_fseek(st->fp, search_info.curr_offset, SEEK_SET);
|
vim_ignored = vim_fseek(st->fp, search_info.curr_offset, SEEK_SET);
|
||||||
}
|
}
|
||||||
|
@ -264,8 +264,15 @@ func Test_tag_complete_with_overlong_line()
|
|||||||
call writefile(tagslines, 'Xtags')
|
call writefile(tagslines, 'Xtags')
|
||||||
set tags=Xtags
|
set tags=Xtags
|
||||||
|
|
||||||
|
" try with binary search
|
||||||
|
set tagbsearch
|
||||||
call feedkeys(":tag inbou\<C-A>\<C-B>\"\<CR>", 'xt')
|
call feedkeys(":tag inbou\<C-A>\<C-B>\"\<CR>", 'xt')
|
||||||
call assert_equal('"tag inboundGSV inboundGovernor inboundGovernorCounters', @:)
|
call assert_equal('"tag inboundGSV inboundGovernor inboundGovernorCounters', @:)
|
||||||
|
" try with linear search
|
||||||
|
set notagbsearch
|
||||||
|
call feedkeys(":tag inbou\<C-A>\<C-B>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"tag inboundGSV inboundGovernor inboundGovernorCounters', @:)
|
||||||
|
set tagbsearch&
|
||||||
|
|
||||||
call delete('Xtags')
|
call delete('Xtags')
|
||||||
set tags&
|
set tags&
|
||||||
|
Loading…
Reference in New Issue
Block a user