[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode f86416b 035/192: Handle indentation in construct
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode f86416b 035/192: Handle indentation in constructors with initializer lists. |
Date: |
Sun, 29 Aug 2021 11:01:45 -0400 (EDT) |
branch: elpa/dart-mode
commit f86416bbf0e600fc88a0463c1ba2ec8c45c3dd84
Author: Nathan Weizenbaum <nweiz@google.com>
Commit: Nathan Weizenbaum <nweiz@google.com>
Handle indentation in constructors with initializer lists.
---
dart-mode.el | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/dart-mode.el b/dart-mode.el
index d4b999f..959067d 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -244,6 +244,17 @@ SYNTAX-GUESS is the output of `c-guess-basic-syntax'."
(beginning-of-line)
(or
+ ;; Handle indentation in a constructor with an initializer on a
+ ;; separate line.
+ (when (memq type '(defun-block-intro inline-close))
+ (save-excursion
+ (c-safe
+ (goto-char (cadr syntax))
+ (when (= (char-after) ?:)
+ (c-beginning-of-statement-1)
+ (setq ad-return-value `((,type ,(point))))
+ t))))
+
;; Handle array literal indentation
(when (memq type
'(arglist-intro
@@ -282,6 +293,14 @@ SYNTAX-GUESS is the output of `c-guess-basic-syntax'."
(setq ad-return-value `((brace-list-entry ,(point))))
t))))))))))
+(defadvice c-inside-bracelist-p (after dart-inside-bracelist-p activate)
+ ;; This function is only called within c-guess-basic-syntax. Since we do all
+ ;; 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))
+ )
+
;;; Boilerplate font-lock piping
- [nongnu] elpa/dart-mode 31861e8 173/192: Add mixin keyword, (continued)
- [nongnu] elpa/dart-mode 31861e8 173/192: Add mixin keyword, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 28ebbaf 176/192: Update tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ea60ffd 178/192: Move README back to markdown, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode bbeadaa 181/192: Reorganize some keyword fontification, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d6afa8c 153/192: Fontify identifiers following declared identifiers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9b65aae 187/192: Add failing tests for fontification of factories and generic methods, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a715dc6 177/192: Move license, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e820b09 155/192: Regex catches dollar signs now, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e5bd30d 184/192: Avoid false positives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9b1c871 001/192: Beginning of dart-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode f86416b 035/192: Handle indentation in constructors with initializer lists.,
ELPA Syncer <=