branch: elpa/d-mode
commit 362be1178b11141415c1ff6df91e3bb0643f213b
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Fix imenu false positive with e.g. private{...}
---
d-mode.el | 4 +++-
tests/imenu2.d | 12 +++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index fa64a80..7afc0fb 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: 201909101232
+;; Version: 201909101234
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -890,6 +890,8 @@ Each list item should be a regexp matching a single
identifier."
(kind (cond
((equal id-prev-token "else")
nil) ; false positive after else
+ ((equal name "{")
+ nil) ; false positive with decl-start keyword and
{...} group
((equal id-prev-token "enum")
"Enums")
((equal id-prev-token "class")
diff --git a/tests/imenu2.d b/tests/imenu2.d
index 2382538..cc443d8 100644
--- a/tests/imenu2.d
+++ b/tests/imenu2.d
@@ -1,6 +1,6 @@
// #min-version: 26.1
// #run: (d-test-get-imenu-lines)
-// #out: (5 6 8 13 18 20 24 28 33 37)
+// #out: (5 6 8 13 18 20 24 28 33 37 40 42 46)
void run(Parameter!("foo()") command) {}
Parameter!("foo()") run(string command) {}
@@ -36,3 +36,13 @@ else
{
int gun();
}
+
+struct S
+{
+ int fun();
+
+ private
+ {
+ int gun();
+ }
+}