-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Multiline regex with capture group substitutes $1 literally until Replace Preview is opened #63297
Comments
(Experimental duplicate detection) |
Can you check whether this works in the latest insiders? It sounds the same as #62980 and this scenario works for me now. But the version you posted above "should" have had that fix already... |
The problem still occurs in Version: 1.30.0-insider Which Regex engine is actually used here? Are both (JS and Rust via ripgrep) involved here somehow and are not fully interchangeable perhaps? BTW. I turned on search.usePCRE2 to see if it makes a difference, but observe the same faulty behavior. |
I see it now. Windows only. |
This is happening for me on macOS, @roblourens. |
In the latest Insiders build? Mac will also fail on 1.29 |
Sorry, on 1.29.1. Carry on. |
This fails with CRLF line endings, you can use |
It's only half a work around: I tried Version: 1.30.0-insider |
Try |
Confirmed to be working. I assume the original issue is considered a bug that needs fixing still? |
Yep |
Version: 1.30.0-insider (but also seen in released 1.29.0)
Commit: 24b0f75
Date: 2018-11-16T06:20:02.054Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
Steps to Reproduce:
Create a folder
multiline-capture
Create a file
test.md
inside the folder with the following content:Open the folder in vscode
Open Search panel, enable regex option and use:
(array).+\n
and$1
Hit return or Refresh. The preview in the search panel shows:
Click on it to open the Replace Preview.
It confirms that the match will be replaced by a literal
$1
Close the Replace Preview. In this moment, the preview in the search panel changes to:
Click on it again to open the full preview and see it confirmed that it will replace it by the capture group value
array
now.Refresh the search. It goes back to
$1
If you use Replace All, the result is as shown in the preview, so the match is either replaced by
$1
orarray
depending on what it showed before you replaced all occurrences.Remove
\n
from the expression and refresh search: The issue does not occur, the preview showsarray
as substitute value immediately.Expected behavior:
I expect it to replace the match with the content of the capture group (which is
array
) all the time.Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: