1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 08:28:01 +01:00

Highlight invalid syntax (sort-of) in javascript completion.

This commit is contained in:
Kris Maglione
2008-10-15 19:40:37 +00:00
parent 07d8bbc159
commit d7872c54f2
2 changed files with 30 additions and 22 deletions

View File

@@ -217,9 +217,13 @@ function Completion() //{{{
let pop = function pop(arg)
{
if (top[CHAR] != arg)
{
commandline.highlight(top[OFFSET] + 1, i + 1, "SPELLCHECK");
commandline.highlight(top[OFFSET], top[OFFSET] + 1, "FIND");
throw new Error("Invalid JS");
}
if (i == str.length - 1)
completion.parenMatch = top[OFFSET];
commandline.highlight(top[OFFSET], top[OFFSET] + 1, "FIND");
// The closing character of this stack frame will have pushed a new
// statement, leaving us with an empty statement. This doesn't matter,
// now, as we simply throw away the frame when we pop it, but it may later.
@@ -324,6 +328,9 @@ function Completion() //{{{
this.complete = function complete(string)
{
commandline.highlight(0, 0, "SPELLCHECK");
commandline.highlight(0, 0, "FIND");
let self = this;
try
{