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();