Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /\\c by requiring odd number of \'s before c for case (in)sensitivity #6900

Merged
merged 2 commits into from
Jul 26, 2021

Conversation

edemaine
Copy link
Contributor

What this PR does / why we need it:
Require an odd number of \s before c for the case (in)sensitivity triggers \c and \C, enabling search for \c via /\\c. This seems to match how vim works.

Which issue(s) this PR fixes
Fixes #6520.

Special notes for your reviewer:

  • Thanks for the pointer to searchState.ts. I actually didn't know \c was a vim feature, which explains why it was just this particular case that was causing problems.
  • I used lookbehind assertions which is not supported in all browsers, but seems to work fine in VSCode/Node.
  • /[\c] is equivalent to /c in vim, but it still won't work with this patch. This seems less common, and I'm not sure how robustly I could fix it with a pure regular expression, and I don't think we really want to parse the whole regular expression...

…vity

Fix VSCodeVim#6520 by requiring an odd number of `\`s before c for the
case (in)sensitivity triggers `\c` and `\C`, enabling search for `\c`
via `/\\c`.  This seems to match how vim works.
Copy link
Member

@J-Fields J-Fields left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks!

@J-Fields J-Fields merged commit 5088801 into VSCodeVim:master Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search for \\c...
2 participants