Patch 8.2.4553

8 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 12, 2022, 12:39:54 PM3/12/22
to vim...@googlegroups.com

Patch 8.2.4553
Problem: Linear tag search is a bit slow.
Solution: Remove a vim_ftell() call. (Yegappan Lakshmanan, closes #9937)
Files: src/tag.c, src/testdir/test_taglist.vim


*** ../vim-8.2.4552/src/tag.c 2022-03-11 14:53:59.820847446 +0000
--- src/tag.c 2022-03-12 17:35:15.210916887 +0000
***************
*** 2092,2101 ****
eof = cs_fgets(st->lbuf, st->lbuf_size);
else
#endif
- {
- sinfo_p->curr_offset = vim_ftell(st->fp);
eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp);
- }
} while (!eof && vim_isblankline(st->lbuf));

if (eof)
--- 2092,2098 ----
***************
*** 2850,2856 ****
return;
}

! if (st->state == TS_STEP_FORWARD)
// Seek to the same position to read the same line again
vim_ignored = vim_fseek(st->fp, search_info.curr_offset,
SEEK_SET);
--- 2847,2853 ----
return;
}

! if (st->state == TS_STEP_FORWARD || st->state == TS_LINEAR)
// Seek to the same position to read the same line again
vim_ignored = vim_fseek(st->fp, search_info.curr_offset,
SEEK_SET);
*** ../vim-8.2.4552/src/testdir/test_taglist.vim 2022-03-06 14:27:06.495895690 +0000
--- src/testdir/test_taglist.vim 2022-03-12 17:35:15.210916887 +0000
***************
*** 259,266 ****
--- 259,273 ----
call writefile(tagslines, 'Xtags')
set tags=Xtags

+ " try with binary search
+ set tagbsearch
call feedkeys(":tag inbou\<C-A>\<C-B>\"\<CR>", 'xt')
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')
set tags&
*** ../vim-8.2.4552/src/version.c 2022-03-12 14:51:12.765797435 +0000
--- src/version.c 2022-03-12 17:37:46.702476309 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4553,
/**/

--
"Women marry men hoping they will change. Men marry women hoping
they will not. So each is inevitably disappointed."
- Einstein

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages