[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 12e45cf 258/346: Fix fontification of properties wi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 12e45cf 258/346: Fix fontification of properties with inferred return type |
Date: |
Sun, 29 Aug 2021 11:00:41 -0400 (EDT) |
branch: elpa/d-mode
commit 12e45cf0978fcee48a54bbdf6c4b9ce4f59ef60f
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Fix fontification of properties with inferred return type
---
d-mode.el | 9 ++++++++-
tests/fonts.d | 2 ++
tests/fonts.d.html | 2 ++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/d-mode.el b/d-mode.el
index 42a0a34..e5d6932 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <russel@winder.org.uk>
;; Vladimir Panteleev <vladimir@thecybershadow.net>
;; Created: March 2007
-;; Version: 201909102153
+;; Version: 201909120240
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -1045,6 +1045,13 @@ Each list item should be a regexp matching a single
identifier."
(apply orig-fun args))
(t
+ ;; Work around a cc-mode bug(?) in which the c-forward-annotation
+ ;; calls in c-forward-decl-or-cast-1 do not advance the start
+ ;; position, causing the annotation to be fontified as the
+ ;; function name.
+ (while (c-forward-annotation)
+ (c-forward-syntactic-ws))
+
(add-function :around (symbol-function 'c-forward-name)
#'d-special-case-c-forward-name)
(unwind-protect
diff --git a/tests/fonts.d b/tests/fonts.d
index eb995c2..76a5a0c 100644
--- a/tests/fonts.d
+++ b/tests/fonts.d
@@ -19,3 +19,5 @@ static if (true) {} else void fun();
scope(exit) fun();
scope(exit) void fun();
+
+@property empty() { return false; }
diff --git a/tests/fonts.d.html b/tests/fonts.d.html
index 0df8a38..ea1d543 100644
--- a/tests/fonts.d.html
+++ b/tests/fonts.d.html
@@ -19,3 +19,5 @@
<span class="keyword">scope</span>(exit) fun();
<span class="keyword">scope</span>(exit) <span class="type">void</span> <span
class="function-name">fun</span>();
+
+<span class="c-annotation-face">@property</span> <span
class="function-name">empty</span>() { <span class="keyword">return</span>
<span class="constant">false</span>; }
- [nongnu] elpa/d-mode c77fc0a 307/346: Skip coverage analysis when byte-compiling, (continued)
- [nongnu] elpa/d-mode c77fc0a 307/346: Skip coverage analysis when byte-compiling, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode d9e9d06 311/346: Merge d-forward-module-clause into d-forward-keyword-clause, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f76ba89 308/346: Fontify (type-inferred) lambda arguments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 34f44cf 337/346: .github/workflows/test.yml: Add Emacs 27.1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 379b00e 144/346: Tweak intro comments a bit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 7d3edd2 234/346: Add test from issue #94, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 968306a 224/346: Add a test case against the now-removed fontification hack, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8e208b2 232/346: Fix imenu display of functions for imenu-add-to-menubar, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b2c9831 252/346: Make imenu hierarchical, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 69df4a3 254/346: Abbreviate symbol kind in imenu entries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 12e45cf 258/346: Fix fontification of properties with inferred return type,
ELPA Syncer <=
- [nongnu] elpa/d-mode 26e7337 253/346: Don't put variables in imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 372c135 274/346: Makefile: Fail on byte-compilation warnings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a0e95f4 282/346: Remove cl-lib dependency, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2b48656 285/346: Simplify c-forward-decl-or-cast-1 advice, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 936944f 294/346: tests: Update test minimal versions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode fb94d19 295/346: Fix fontification of "xxxmodule.yyy", ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 6cbba0e 301/346: Fix fontification of lone protection labels, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2bb5809 304/346: Move conditional compilation to within function bodies, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c29b03d 302/346: .travis.yml: Remove redundant "compile" step, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c8413d2 317/346: tests: Rename fonts_lambda_params to fonts_params, ELPA Syncer, 2021/08/29