[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19946: 24.4; js-mode, indentation
From: |
Simen Heggestøyl |
Subject: |
bug#19946: 24.4; js-mode, indentation |
Date: |
Sat, 19 Mar 2016 23:13:11 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) |
Can confirm that this bug is still present on the current master branch
(070b9de). The following patch seems to fix it:
>From 9b9f09d518617d165833602d863ea8afedcec401 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg@gmail.com>
Date: Sat, 19 Mar 2016 21:33:02 +0100
Subject: [PATCH] Handle indentation after carriage return better
* lisp/progmodes/js.el (js--proper-indentation): Handle indentation
after carriage return better (bug#19946).
---
lisp/progmodes/js.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1e5cc60..a156080 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1963,7 +1963,7 @@ js--proper-indentation
(switch-keyword-p (looking-at "default\\_>\\|case\\_>[^:]"))
(continued-expr-p (js--continued-expression-p)))
(goto-char (nth 1 parse-status)) ; go to the opening char
- (if (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
+ (if (looking-at "[({[]\\s-*\\(/[/*]\\|\n\\|\r\\)")
(progn ; nothing following the opening paren/bracket
(skip-syntax-backward " ")
(when (eq (char-before) ?\)) (backward-list))
--
2.7.0
- bug#19946: 24.4; js-mode, indentation,
Simen Heggestøyl <=
- bug#19946: 24.4; js-mode, indentation, Dmitry Gutov, 2016/03/19
- bug#19946: 24.4; js-mode, indentation, Andreas Schwab, 2016/03/20
- bug#19946: 24.4; js-mode, indentation, Jostein Kjønigsen, 2016/03/20
- bug#19946: 24.4; js-mode, indentation, Dmitry Gutov, 2016/03/20
- bug#19946: 24.4; js-mode, indentation, Jostein Kjønigsen, 2016/03/20
- bug#19946: 24.4; js-mode, indentation, Dmitry Gutov, 2016/03/20
- bug#19946: 24.4; js-mode, indentation, Daniel Colascione, 2016/03/20
- bug#19946: 24.4; js-mode, indentation, Dmitry Gutov, 2016/03/20