From f0ddfeb558ca97c91e6083258c888b02e0446c62 Mon Sep 17 00:00:00 2001 From: Lox Date: Fri, 7 Jul 2023 23:28:17 +0200 Subject: [PATCH] quickfix --- main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.ts b/main.ts index aba0d1a..289cb71 100644 --- a/main.ts +++ b/main.ts @@ -455,8 +455,8 @@ export default class VimrcPlugin extends Plugin { throw new Error("surround requires exactly 2 parameters: prefix and postfix text."); } - let beginning = newArgs[0].replace(/\\(.)/g, function(str, char) { return escapeCodes[char]; }); // Get the beginning surround text - let ending = newArgs[1].replace(/\\(.)/g, function(str, char) { return escapeCodes[char]; }); // Get the ending surround text + let beginning = newArgs[0].replace(/\\([\\rntsb &])/g, function(str, char) { return escapeCodes[char]; }); // Get the beginning surround text + let ending = newArgs[1].replace(/\\([\\rntsb &])/g, function(str, char) { return escapeCodes[char]; }); // Get the ending surround text let currentSelections = this.currentSelection; var chosenSelection = currentSelections?.[0] ? currentSelections[0] : {anchor: editor.getCursor(), head: editor.getCursor()};