File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -539,6 +539,20 @@ comment at the start of cc-engine.el for more info."
539539 rtn))
540540
541541
542+ (defun csharp-is-square-parentasis-block-p ()
543+ " Attempts to safely assess if the current point is at the opening of
544+ a square parentasis block [ ... ]."
545+ (let* ((start (point )) ; ; variables used to hold our position, so that we know that
546+ (end)) ; ; our code isn't stuck trying to look for a non-existant sexp.
547+ (and (eq (char-after ) 91 ) ; ; open square
548+ (while (and (eq (char-after ) 91 )
549+ (not (eq start end)))
550+ (c-safe (c-forward-sexp 1 ))
551+ (setq end (point )))
552+ (eq (char-before ) 93 ))) ; ; close square
553+ )
554+
555+
542556
543557; ; ==================================================================
544558; ; end of csharp-mode utility and feature defuns
@@ -942,10 +956,7 @@ comment at the start of cc-engine.el for more info."
942956
943957 (if (or
944958 (eq (char-after ) ?{ ) ; ; open curly
945- (and (eq (char-after ) 91 ) ; ; open square
946- (while (eq (char-after ) 91 )
947- (c-safe (c-forward-sexp 1 )))
948- (eq (char-before ) 93 )) ; ; close square
959+ (csharp-is-square-parentasis-block-p)
949960 (and (eq (char-after ) 40 ) ; ; open paren
950961 (c-safe (c-forward-sexp 1 ) t )))
951962
You can’t perform that action at this time.
0 commit comments