branch: elpa/d-mode
commit 9f6a2b6bc1b241aada54366636af0a0259f3bde7
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Handle c-forward-sexp error in d-around--c-get-fontification-context
---
d-mode.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index e97ff69..404552a 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -836,13 +836,15 @@ CONTEXT is as in `c-forward-decl-or-cast-1'."
((looking-at (d-make-keywords-re t '("catch")))
(setq type 'decl)
t))))
- (progn
- (c-forward-sexp)
- (c-forward-syntactic-ws)
- (while (d-forward-attribute-or-storage-class 'top))
- (or
- (eq (char-after) ?\{)
- (looking-at "=>"))))))))
+ (condition-case nil
+ (progn
+ (c-forward-sexp)
+ (c-forward-syntactic-ws)
+ (while (d-forward-attribute-or-storage-class 'top))
+ (or
+ (eq (char-after) ?\{)
+ (looking-at "=>")))
+ (error nil)))))))
(setq res (cons type t))
;; (message " patching -> %S" res)