]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/js.el (js-indent-line): Don't mix columns and chars.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 1 Jun 2014 01:53:04 +0000 (21:53 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 1 Jun 2014 01:53:04 +0000 (21:53 -0400)
Fixes: debbugs:17619
lisp/ChangeLog
lisp/progmodes/js.el

index 20257f089d9a1a5e180e69cb2a95d3fe9f5a581a..f1e3af8123d530b9434db884ffd5725afbb14c5f 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/js.el (js-indent-line): Don't mix columns and chars
+       (bug#17619).
+
 2014-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * subr.el (set-transient-map): Don't wait for some "nested"
index 5be1373213e04895dd9348437d4dbb2e0c7d9cb0..a8f0d556ec417e96f93beb3acd4cac087ba182fb 100644 (file)
@@ -1907,7 +1907,7 @@ In particular, return the buffer position of the first `for' kwd."
   (interactive)
   (let* ((parse-status
           (save-excursion (syntax-ppss (point-at-bol))))
-         (offset (- (current-column) (current-indentation))))
+         (offset (- (point) (save-excursion (back-to-indentation) (point)))))
     (indent-line-to (js--proper-indentation parse-status))
     (when (> offset 0) (forward-char offset))))