branch: elpa/d-mode
commit 166fac86b2b594e2b14023d61157779a355d1d3a
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Fix fontification of second foreach variable
https://github.com/Emacs-D-Mode-Maintainers/Emacs-D-Mode/pull/93#commitcomment-35907724
---
d-mode.el | 4 ++--
tests/I0093_35907724.d | 4 ++++
tests/I0093_35907724.d.html | 4 ++++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 06ec3d5..6ac7369 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: 201911121009
+;; Version: 201911121026
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -516,7 +516,7 @@ Evaluate OLD-FORM if the Emacs version is older than
MIN-VERSION,
;; (message "(d-forward-decl-or-cast-1 %S %S %S) @ %S" preceding-token-end
context last-cast-end (point))
;; D: Restore our context, if any
- (when (eq context 'decl)
+ (when (memq context '(arglist decl))
(save-excursion
(c-backward-syntactic-ws)
(when (> (point) (point-min))
diff --git a/tests/I0093_35907724.d b/tests/I0093_35907724.d
new file mode 100644
index 0000000..96b1de3
--- /dev/null
+++ b/tests/I0093_35907724.d
@@ -0,0 +1,4 @@
+// #min-version: 26.1
+// #run: (d-test-fontification)
+
+foreach (const offset, const ref element; haystack) fun();
diff --git a/tests/I0093_35907724.d.html b/tests/I0093_35907724.d.html
new file mode 100644
index 0000000..7e5965a
--- /dev/null
+++ b/tests/I0093_35907724.d.html
@@ -0,0 +1,4 @@
+<span class="comment-delimiter">// </span><span class="comment">#min-version:
26.1
+</span><span class="comment-delimiter">// </span><span class="comment">#run:
(d-test-fontification)
+</span>
+<span class="keyword">foreach</span> (<span class="keyword">const</span> <span
class="variable-name">offset</span>, <span class="keyword">const ref</span>
<span class="variable-name">element</span>; haystack) fun();