From 64e415297c09d9c92a6b1460c19f97fb4446844d Mon Sep 17 00:00:00 2001 From: Mihir Rege Date: Mon, 25 Nov 2013 00:01:08 +0200 Subject: [PATCH] * lisp/progmodes/js.el (js--ctrl-statement-indentation): Fix indent when control-statement is the first statement in a buffer. Fixes: debbugs:15956 --- lisp/ChangeLog | 5 +++++ lisp/progmodes/js.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 36c4c6ae4e..7365e8c274 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-22 Mihir Rege (tiny change) + + * progmodes/js.el (js--ctrl-statement-indentation): Fix indent + when control-statement is the first statement in a buffer (Bug#15956). + 2013-11-24 Dmitry Gutov * imenu.el (imenu-generic-skip-comments-and-strings): diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 49a2193313..17c13607d7 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 " ") -- 2.20.1