branch: elpa/d-mode
commit 06fb0ffbf2754e0124b0549db97b26d7dc084df9
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Fix indentation of enums with a base type
Enable c-recognize-post-brace-list-type-p.
Fixes #19.
---
d-mode-test.el | 1 +
d-mode.el | 7 ++++++-
tests/I0019.d | 7 +++++++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/d-mode-test.el b/d-mode-test.el
index a000689..de4f69f 100644
--- a/d-mode-test.el
+++ b/d-mode-test.el
@@ -303,6 +303,7 @@ is expected to succeed, and nil otherwise."
;; Run the tests
(d-test-deftest imenu "tests/imenu.d" t)
(d-test-deftest fonts "tests/fonts.d" t)
+(d-test-deftest i0019 "tests/I0019.d" (version< "25.1" emacs-version))
(d-test-deftest i0021 "tests/I0021.d" t)
(d-test-deftest i0026 "tests/I0026.d" t)
(d-test-deftest i0030 "tests/I0030.d" t)
diff --git a/d-mode.el b/d-mode.el
index 43d4356..185e215 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <[email protected]>
;; Vladimir Panteleev <[email protected]>
;; Created: March 2007
-;; Version: 201908270011
+;; Version: 201908270026
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "24.3"))
@@ -380,6 +380,11 @@ The expression is added to
`compilation-error-regexp-alist' and
"sizeof" "typeid" "typeof"))
+(c-lang-defconst c-recognize-post-brace-list-type-p
+ ;; Set to t when we recognize a colon and then a type after an enum,
+ ;; e.g., enum foo : int { A, B, C };"
+ d t)
+
(defcustom d-font-lock-extra-types nil
"*List of extra types (aside from the type keywords) to recognize in D mode.
diff --git a/tests/I0019.d b/tests/I0019.d
new file mode 100644
index 0000000..f16181c
--- /dev/null
+++ b/tests/I0019.d
@@ -0,0 +1,7 @@
+// #run: (d-test-indent)
+
+enum OtherValues2 : uint {
+ a = 2u,
+ b = 4u,
+ c
+}