From ce65d762a065b9dcb190e22535bbeb12d4a5d31d Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 11 Oct 2008 06:48:05 +0000 Subject: [PATCH] Properly allow $ in identifiers in JS completer --- content/completion.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/completion.js b/content/completion.js index 9abd21c0..a042307a 100644 --- a/content/completion.js +++ b/content/completion.js @@ -279,12 +279,12 @@ liberator.Completion = function () //{{{ { // A word character following a non-word character, or simply a non-word // character. Start a new statement. - if (/[\w$]/.test(c) && !/[\w\d$]/.test(lastChar) || !/[\w\d\s]/.test(c)) + if (/[\w$]/.test(c) && !/[\w\d$]/.test(lastChar) || !/[\w\d\s$]/.test(c)) top[STATEMENTS].push(i); // A "." or a "[" dereferences the last "statement" and effectively // joins it to this logical statement. - if ((c == "." || c == "[") && /[\w\d\])"']/.test(lastNonwhite) + if ((c == "." || c == "[") && /[\w\d$\])"']/.test(lastNonwhite) || lastNonwhite == "." && /[\w$]/.test(c)) top[STATEMENTS].pop(); @@ -292,7 +292,7 @@ liberator.Completion = function () //{{{ { case "(": /* Function call, or if/while/for/... */ - if (/\w/.test(lastNonwhite)) + if (/\w$/.test(lastNonwhite)) { top[FUNCTIONS].push(i); top[STATEMENTS].pop();