Ignore errors when checking for object initializers (bug#63379)

Since this is merely a check for syntax, we don't really care about
any internal errors inside of backward-up-list.

* lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Wrap
command in ignore-errors.
This commit is contained in:
Theodor Thornhill 2023-09-02 19:34:46 +02:00
parent 3550f44c17
commit dd896ea1e6
No known key found for this signature in database
GPG key ID: 2B8CF6039F079DA3

View file

@ -493,7 +493,7 @@ compilation and evaluation time conflicts."
;; Next non-whitespace character should be '{' ;; Next non-whitespace character should be '{'
(goto-char (c-point 'boi)) (goto-char (c-point 'boi))
(unless (eq (char-after) ?{) (unless (eq (char-after) ?{)
(backward-up-list 1 t t)) (ignore-errors (backward-up-list 1 t t)))
(save-excursion (save-excursion
;; 'new' should be part of the line ;; 'new' should be part of the line
(goto-char (c-point 'iopl)) (goto-char (c-point 'iopl))