[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode f50a1cc 037/192: Properly indent after construct
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode f50a1cc 037/192: Properly indent after constructors with member lists. |
Date: |
Sun, 29 Aug 2021 11:01:46 -0400 (EDT) |
branch: elpa/dart-mode
commit f50a1ccb5fd90cc2e545af444b954e514aab92ef
Author: Nathan Weizenbaum <nweiz@google.com>
Commit: Nathan Weizenbaum <nweiz@google.com>
Properly indent after constructors with member lists.
---
dart-mode.el | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index f03e048..19c4cfa 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -36,7 +36,6 @@
;; * String interpolation isn't fontified as Dart.
;; * Methods and constructors without return types aren't fontified correctly.
;; * Untyped parameters aren't fontified correctly.
-;; * Member initializers tend to screw with indentation.
;;; Code:
@@ -152,6 +151,9 @@
(c-lang-defconst c-before-label-kwds
dart '("break" "continue"))
+(c-lang-defconst c-nonlabel-token-key
+ dart (concat (concat "\\s\(\\|" (c-lang-const c-nonlabel-token-key))))
+
(c-lang-defconst c-inexpr-class-kwds
dart nil)
@@ -306,8 +308,23 @@ SYNTAX-GUESS is the output of `c-guess-basic-syntax'."
;; out brace-list detection in our advice, we just never report being in a
;; bracelist there.
(when (c-major-mode-is 'dart-mode)
- (setq ad-return-value nil))
- )
+ (setq ad-return-value nil)))
+
+(defadvice c-search-decl-header-end (around dart-search-decl-header-end
activate)
+ (if (not (c-major-mode-is 'dart-mode))
+ (ad-do-it)
+ (let ((base (point)))
+ (while (and
+ (c-syntactic-re-search-forward "[;{=:]" nil 'move t t)
+ (c-end-of-current-token base))
+ (setq base (point)))
+ ;; If we hit :, we're in a member initialization list and we want to
+ ;; ignore = signs.
+ (when (= (char-before) ?:)
+ (while (and
+ (c-syntactic-re-search-forward "[;{]" nil 'move t t)
+ (c-end-of-current-token base))
+ (setq base (point)))))))
;;; Boilerplate font-lock piping
- [nongnu] branch elpa/dart-mode created (now 43975c9), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode fc47325 012/192: Fix more keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 50cbb65 015/192: Add a license (GPL3)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 58c9bac 016/192: Add a copyright header., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 44c762d 022/192: More known bugs., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode f50a1cc 037/192: Properly indent after constructors with member lists.,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 9be0c64 050/192: Add support for flymake., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 273f8da 053/192: Work around some dart_analzer/Emacs disagreements., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 010f557 055/192: changed (ad-do-it) to ad-do-it, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 6f66034 008/192: Improve indentation., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a081d12 011/192: Set version to 0.1., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 84580a5 021/192: Fix else block indentation., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c6478e8 026/192: Add a dart c style., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ff905a9 056/192: Merge pull request #3 from patefacio/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode f35222d 057/192: Fix an error in the flymake hook., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c6969ba 061/192: Add some support for the Dart formatter., ELPA Syncer, 2021/08/29