forked from aniani/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 #9937)
This commit is contained in:
committed by
Bram Moolenaar
parent
d0b7bfa957
commit
8b530b3158
@@ -2092,10 +2092,7 @@ findtags_get_next_line(findtags_state_T *st, tagsearch_info_T *sinfo_p)
|
|||||||
eof = cs_fgets(st->lbuf, st->lbuf_size);
|
eof = cs_fgets(st->lbuf, st->lbuf_size);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
sinfo_p->curr_offset = vim_ftell(st->fp);
|
|
||||||
eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp);
|
eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp);
|
||||||
}
|
|
||||||
} while (!eof && vim_isblankline(st->lbuf));
|
} while (!eof && vim_isblankline(st->lbuf));
|
||||||
|
|
||||||
if (eof)
|
if (eof)
|
||||||
@@ -2850,7 +2847,7 @@ line_read_in:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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,
|
vim_ignored = vim_fseek(st->fp, search_info.curr_offset,
|
||||||
SEEK_SET);
|
SEEK_SET);
|
||||||
|
@@ -259,8 +259,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&
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4553,
|
||||||
/**/
|
/**/
|
||||||
4552,
|
4552,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user