diff --git a/common/content/editor.js b/common/content/editor.js index 307a7ac3..25159808 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -165,7 +165,7 @@ function Editor() //{{{ function (args) { let [lhs, rhs] = args; - if (lhs && lhs.match(/\W/)) + if (lhs && lhs.match(/[\s"']/)) { liberator.echoerr("E474: Invalid argument"); return false; @@ -1015,7 +1015,7 @@ function Editor() //{{{ let text = textbox.value; let currStart = textbox.selectionStart; let currEnd = textbox.selectionEnd; - let foundWord = text.substring(0, currStart).replace(/^(.|\n)*?(\w+)$/m, "$2"); // get last word \b word boundary + let foundWord = text.substring(0, currStart).replace(/^(.|\n)*?([^\s"']+)$/m, "$2"); // get last word \b word boundary if (!foundWord) return true;