`:%s` does not highlight in editor when using capture groups.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
When using \( and \) to indicate a group, the matches will not be highlighted in editor.
To Reproduce
For
a = "foo"
b = "@foo"
the pattern :%s/"\(@*\)foo"/"\1baz"\g, will correctly sustitute to
a = "baz"
b = "@baz"
however the changes will not be previewed in editor.
The pattern :%s/"(@*)foo"/"\1baz"\g, will indicate the changes in editor, but produce a pattern not found error when executed.
Expected behavior
:%s/"\(@*\)foo"/"\1baz"\gshould match in the editor.:%s/"(@*)foo"/"\1baz"\gshould not match in the editor.
Environment (please complete the following information):
Extension version: 1.23.2
VS Code version: Code - Insiders 1.72.0-insider (1a55beb2aaee64eb8d0cbe5b61b10088bbc6c895, 2022-09-13T05:32:07.204Z)
OS version: Darwin arm64 21.6.0
Modes:
Sandboxed: Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two substitution patterns in the VS Code Vim editor using the issue's sample text, comparing preview highlighting with executed substitution behavior. Trace the editor's substitution-preview and capture-group handling until the escaped-group pattern previews correctly and the unescaped pattern does not; verify both expected behaviors against the reported VS Code and extension versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100