emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/dart-mode 84580a5 021/192: Fix else block indentation.


From: ELPA Syncer
Subject: [nongnu] elpa/dart-mode 84580a5 021/192: Fix else block indentation.
Date: Sun, 29 Aug 2021 11:01:42 -0400 (EDT)

branch: elpa/dart-mode
commit 84580a59505531394f6698bfa316270edcb3acb4
Author: Nathan Weizenbaum <nweiz@google.com>
Commit: Nathan Weizenbaum <nweiz@google.com>

    Fix else block indentation.
---
 dart-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dart-mode.el b/dart-mode.el
index f76eeec..2dfddfd 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -32,7 +32,6 @@
 ;; * Multiline strings using """ and ''' are not recognized. They fontify
 ;;   correctly, but only because they look like three strings in a row.
 ;; * In a map with identifier keys, the first key is fontified like a label.
-;; * else blocks are indented incorrectly.
 ;; * Optional arguments aren't always fontified correctly.
 ;; * =>-style methods that span multiple lines can screw up indentation and
 ;;   brace matching.
@@ -197,6 +196,8 @@ SYNTAX-GUESS is the output of `c-guess-basic-syntax'."
          ;; Both anonymous and named functions have a ")" immediately before 
the
          ;; code block.
          (= (char-before) ?\))
+         ;; "else" is the only keyword that comes immediately before a block.
+         (looking-back "\\<else\\>")
          ;; CC is good at figuring out if we're in a class.
          (assq 'inclass syntax-guess))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]