Fix indent for enums in csharp-mode
* lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Check for keywords containing 'enum' on the line before an opening bracket, and make it behave like a class-open token.
This commit is contained in:
parent
dfde902f3b
commit
e205f68717
1 changed files with 9 additions and 0 deletions
|
@ -464,6 +464,15 @@ compilation and evaluation time conflicts."
|
||||||
|
|
||||||
(defun csharp-guess-basic-syntax (orig-fun &rest args)
|
(defun csharp-guess-basic-syntax (orig-fun &rest args)
|
||||||
(cond
|
(cond
|
||||||
|
(;; enum
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (c-point 'boi))
|
||||||
|
(and
|
||||||
|
(eq (char-after) ?\{)
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (c-point 'iopl))
|
||||||
|
(looking-at ".*enum.*"))))
|
||||||
|
`((class-open ,(c-point 'iopl))))
|
||||||
(;; Attributes
|
(;; Attributes
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (c-point 'iopl))
|
(goto-char (c-point 'iopl))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue