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

Find Next Selection, regex enabled: preserve escaping #38232

Closed
OnlineCop opened this issue Nov 13, 2017 · 0 comments · Fixed by #43950
Closed

Find Next Selection, regex enabled: preserve escaping #38232

OnlineCop opened this issue Nov 13, 2017 · 0 comments · Fixed by #43950
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-find Editor find operations verified Verification succeeded
Milestone

Comments

@OnlineCop
Copy link

  • VSCode Version: Code 1.18.0 (dcee220, 2017-11-08T12:44:48.751Z)
  • OS Version: Linux x64 4.4.0-98-generic
  • Extensions:
Extension Author (truncated) Version
sort-lines Tyr 1.3.0
code-gnu-global aus 0.2.2
CppSnippets har 0.0.13
cmake-tools-helper mad 0.1.1
cpptools ms- 0.14.2
cmake-tools vec 0.10.3
clang-format xav 1.6.1

I'm editing C++, C#, Javascript, Java, although this appears reproducible regardless of language.

I have ctrl+f bound to actions.find. Regex is enabled, and if I select text containing any regex meta-characters, those are properly escaped in the Find window: { "key": "ctrl+f", "command": "actions.find" } becomes \{ "key": "ctrl\+f", "command": "actions\.find" \}

I have ctrl+f3 bound to editor.action.nextSelectionMatchFindAction. Regex is (still) enabled, and if I select text containing regex meta-characters, those are NOT properly escaped in the Find window: { "key": "ctrl+f", "command": "actions.find" } remains { "key": "ctrl+f", "command": "actions.find" } which is then an invalid regex pattern.


Steps to Reproduce:

  1. Select text that contains regex meta-characters: .*+{}[]
  2. Press ctrl+f or go to Edit->Find to open the Find window. If Use Regular Expression (Alt+R) is not already selected, press alt+r and (with the text still selected), press ctrl+f again so text in the Find window updates.
  3. Text in the Find window should be escaped.

This is correct behavior.

  1. Select text that contains regex meta-characters: .*+{}[]
  2. Press ctrl+f3 to open the Find window with that text selected.
  3. Toggle Use Regular Expression (Alt+R), then press ctrl+f3 again so text in the Find window updates.
  4. Text in the Find window is not escaped.

I would expect the text to be escaped, like it is with actions.find.

Reproduces without extensions: Yes

@vscodebot vscodebot bot added new release editor-find Editor find operations labels Nov 13, 2017
@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Nov 13, 2017
@alexdima alexdima removed the editor label Nov 24, 2017
irrationalRock added a commit to irrationalRock/vscode that referenced this issue Feb 18, 2018
@alexdima alexdima assigned alexdima and unassigned rebornix Mar 1, 2018
@alexdima alexdima modified the milestones: February 2018, Backlog Mar 1, 2018
@alexdima alexdima modified the milestones: Backlog, February 2018 Mar 1, 2018
@mjbvz mjbvz added the verified Verification succeeded label Mar 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-find Editor find operations verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants