[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 0a2a3b0 066/459: Fix Emacs-lockup during fo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 0a2a3b0 066/459: Fix Emacs-lockup during fontification. |
Date: |
Sun, 22 Aug 2021 13:58:57 -0400 (EDT) |
branch: externals/csharp-mode
commit 0a2a3b0943c2463ca38b673c6c42d2e3e9bc2d5a
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Fix Emacs-lockup during fontification.
Fixes non-exiting loop in detection of square-parentasis regions.
Closes https://github.com/josteink/csharp-mode/issues/17.
---
csharp-mode.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/csharp-mode.el b/csharp-mode.el
index 75e3130..e2003e7 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -539,6 +539,20 @@ comment at the start of cc-engine.el for more info."
rtn))
+(defun csharp-is-square-parentasis-block-p ()
+ "Attempts to safely assess if the current point is at the opening of
+a square parentasis block [ ... ]."
+ (let* ((start (point)) ;; variables used to hold our position, so that we
know that
+ (end)) ;; our code isn't stuck trying to look for a
non-existant sexp.
+ (and (eq (char-after) 91) ;; open square
+ (while (and (eq (char-after) 91)
+ (not (eq start end)))
+ (c-safe (c-forward-sexp 1))
+ (setq end (point)))
+ (eq (char-before) 93))) ;; close square
+ )
+
+
;; ==================================================================
;; end of csharp-mode utility and feature defuns
@@ -942,10 +956,7 @@ comment at the start of cc-engine.el for more info."
(if (or
(eq (char-after) ?{) ;; open curly
- (and (eq (char-after) 91) ;; open square
- (while (eq (char-after) 91)
- (c-safe (c-forward-sexp 1)))
- (eq (char-before) 93)) ;; close
square
+ (csharp-is-square-parentasis-block-p)
(and (eq (char-after) 40) ;; open paren
(c-safe (c-forward-sexp 1) t)))
- [elpa] externals/csharp-mode 7ef0c5c 032/459: Configure travis-build., (continued)
- [elpa] externals/csharp-mode 7ef0c5c 032/459: Configure travis-build., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2fe1a72 033/459: Fix error in path in makefile., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3d0f86b 043/459: Updated readme., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode fff8cb1 053/459: Merge branch 'devel', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 689dd8b 056/459: make c# style the default style, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 421d3de 062/459: remove aspx code, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 962478e 057/459: Merge branch 'devel', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2d13a9c 058/459: Add very broad build-level test., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 723341b 067/459: Fix incorrect-code tags in readme., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a86839b 064/459: Merged from master., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0a2a3b0 066/459: Fix Emacs-lockup during fontification.,
ELPA Syncer <=
- [elpa] externals/csharp-mode f2fda33 041/459: Fix errors in `make package`., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a6eb8bd 047/459: Merge changes from branch 'devel', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6289cfd 051/459: Fix broken byte-compile., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1f2fc21 055/459: Remove obsolete workarounds from README., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d7ba765 063/459: Merge changes from devel., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ed628e6 075/459: Attempt fix compilation-mode regexps for both xbuild & msbuild., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3c2f942 087/459: Merge pull request #34 from binki/master, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 31eebb9 079/459: create separate compilation regexps for xbuild, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 42ca773 097/459: Fix runtime warnings about obsolete Emacs-functions., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0779fe4 107/459: Update changelog., ELPA Syncer, 2021/08/22