Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Vim * and # Quick Search not working properly with tabs surrounding words

Open kneden opened this issue 6 years ago • 1 comments

Describe the bug When on a word with one (or more) tabs immediately before or after it, using the quick search '*' and '#' do not work as expected.

For example, if the word 'foo' has a single tab before it (and no tabs after), then <tab>foo is used for searching, instead of \bfoo\b. (<tab> = tab character)

Additional tabs before and after 'foo' will be added to the search. <tab><tab>foo<tab><tab><tab> will search for <tab><tab>foo<tab><tab><tab>.

If a word has trailing tabs, but not leading ones, then the result is a bit different: foo<tab>foo will search for \bfoo<tab>foo\b.

To Reproduce Steps to reproduce the behavior:

  1. Populate a file with one (or more) examples from the above description.
  2. Put the cursor on the word and use '*' or '#' to do a forward or reverse search.
  3. To see what is being searched, '/' and up-arrow.

Expected behavior Standard Vim does not exhibit these behaviours. Using quick search on foo will not include leading or trailing tabs; `\bfoo\b' should be the search target. Confirmed this with Vim version 8.1.2234 (default config: no .vimrc)

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.15.0
  • VSCode version: 1.47.2
  • OS: Darwin x64 18.7.0 (macOS 10.14.6 (18G6020))
  • vim.hlsearch setting is true.

Additional context This is not present in version 1.14.0. Possibly introduced by the changes for #5001.

kneden avatar Jul 20 '20 15:07 kneden

Duplicate of #5026, fixed in next release (hopefully today)

J-Fields avatar Jul 20 '20 15:07 J-Fields