vim: Fix incorrect escaping parenthesis of replacement string (#29555)

Closes #29356

![Screenshot 2025-04-28
233018](https://github.com/user-attachments/assets/22998e70-8430-45fc-8d51-14e862e585eb)


Release Notes:

- vim: Fixed a bug when escaping `(` and `)` in command-palette find and
replace
This commit is contained in:
Hilda24 authored and GitHub committed 2025-04-29 19:55:02 -06:00
1 parent 7430343990
commit 79e4dfe761
1 file changed
+2 -2
+2 -2
View File
@@ -542,7 +542,7 @@ impl Replacement {
if phase == 1 && c.is_ascii_digit() {
buffer.push('$')
// unescape escaped parens
} else if phase == 0 && c == '(' || c == ')' {
} else if phase == 0 && (c == '(' || c == ')') {
} else if c != delimiter {
buffer.push('\\')
}
@@ -561,7 +561,7 @@ impl Replacement {
}
} else {
// escape unescaped parens
if phase == 0 && c == '(' || c == ')' {
if phase == 0 && (c == '(' || c == ')') {
buffer.push('\\')
}
buffer.push(c)