From e7ad799f7360eebc9b93176c3ce321967afc535e Mon Sep 17 00:00:00 2001 From: Mihir Rege Date: Sat, 23 Nov 2013 03:14:27 +0530 Subject: [PATCH] Fix indentation for control statements --- lisp/ChangeLog | 5 +++++ lisp/progmodes/js.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 50e2ff6..ec356a5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-22 Mihir Rege + + * progmodes/js.el (js--ctrl-statement-indentation): Fix indent + if control-statement is first statement in buffer. + 2013-11-22 Leo Liu * progmodes/octave.el (inferior-octave-startup): Spit out error diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 49a2193..17c1360 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1749,8 +1749,8 @@ nil." (when (save-excursion (and (not (eq (point-at-bol) (point-min))) (not (looking-at "[{]")) + (js--re-search-backward "[[:graph:]]" nil t) (progn - (js--re-search-backward "[[:graph:]]" nil t) (or (eobp) (forward-char)) (when (= (char-before) ?\)) (backward-list)) (skip-syntax-backward " ") -- 1.8.1.2