]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix a bug where strings were matched.
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 18 Nov 2014 17:39:01 +0000 (09:39 -0800)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 18 Nov 2014 17:39:01 +0000 (09:39 -0800)
.gitignore
context-coloring.el
scripts/tokenizer.js

index 016d3b1692b6a264546cdf12af5ba8dfdbee4247..c531d9867f6c223be1daf0f6da7538feb11966d8 100644 (file)
@@ -1 +1 @@
-*.elc
\ No newline at end of file
+*.elc
index 0a724296078dbe8a0144e3de4906124281465c91..3d886614508883e599fd69211f7abdf79f4b58f4 100644 (file)
@@ -111,15 +111,20 @@ Return the name of the temporary file."
 (define-minor-mode context-coloring-mode
   "Context-based code coloring for JavaScript, inspired by Douglas Crockford."
   nil " Context" nil
+  (make-local-variable 'jit-lock-stealth-time)
   (make-local-variable 'jit-lock-chunk-size)
   (make-local-variable 'jit-lock-contextually)
   (if (not context-coloring-mode)
       (progn
+        (setq jit-lock-stealth-time nil)
         (setq jit-lock-chunk-size 500)
         (setq jit-lock-contextually `syntax-driven)
-        (jit-lock-unregister 'context-coloring-fontify-region))
+        (jit-lock-unregister 'context-coloring-fontify-region)
+        (jit-lock-register 'font-lock-fontify-region))
+    (setq jit-lock-stealth-time 1)
     (setq jit-lock-chunk-size 536870911)
     (setq jit-lock-contextually nil)
+    (jit-lock-unregister 'font-lock-fontify-region)
     (jit-lock-register 'context-coloring-fontify-region)))
 
 ;;;###autoload
index 0e799d12f6852768ddc9c115a3dd3d49d3694b18..b7b3268d8dbe614c897c55822ae76becf0a45e30 100644 (file)
@@ -64,7 +64,8 @@ process.stdin.on('end', function () {
 
         // Globality is not indicated by origin function.
         if (token.kind !== 'function' &&
-                data.global.indexOf(token.string) > -1) {
+                (token.identifier &&
+                 data.global.indexOf(token.string) > -1)) {
             level = 0;
         } else {
             level = origin.function.level;