]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix 'jumping cursor' problem
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 8 Jan 2012 18:55:50 +0000 (22:55 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 8 Jan 2012 18:55:50 +0000 (22:55 +0400)
Regression from the previous commit.
Refs #31.

js2-mode.el

index 0b53e2778b39f313975b29c9eb30ff5a49f1393c..034d195ae14809d12dc58635918355bd7942aeac 100644 (file)
@@ -7327,9 +7327,9 @@ leaving a statement, an expression, or a function definition."
         (max-specpdl-size (max max-specpdl-size 3000))
         (case-fold-search nil)
         ast)
-    (or buf (setq buf (current-buffer)))
     (message nil)  ; clear any error message from previous parse
-    (with-current-buffer buf
+    (save-excursion
+      (when buf (set-buffer buf))
       (setq js2-scanned-comments nil
             js2-parsed-errors nil
             js2-parsed-warnings nil