Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit fefbab2

Browse files
committed
added fix to properly replace literals
1 parent e8ef49b commit fefbab2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/text-buffer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,9 @@ class TextBuffer {
16081608
let replacements = 0
16091609

16101610
this.transact(() => {
1611-
return this.scan(regex, function ({replace}) {
1611+
return this.scan(regex, function ({matchText, replace}) {
1612+
const text = matchText.replace(regex, replacementText)
1613+
replacementText = text === matchText ? replacementText : text
16121614
replace(replacementText)
16131615
return replacements++
16141616
})

0 commit comments

Comments
 (0)