vim: Fix incorrect escaping parenthesis of replacement string (#29555)
Closes #29356  Release Notes: - vim: Fixed a bug when escaping `(` and `)` in command-palette find and replace
This commit is contained in:
parent
e364e48266
commit
75a9ed164b
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue