GNU bug report logs -
#19946
js-mode indentation with mixed Unix/DOS line endings
Previous Next
Reported by: jostein <at> kjonigsen.net
Date: Wed, 25 Feb 2015 16:45:03 UTC
Severity: minor
Tags: wontfix
Found in version 24.4
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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 <at> 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
This bug report was last modified 5 years ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.