Skip to content

Commit 0027f9c

Browse files
Tim Van Holderjosteink
authored andcommitted
Issue #112: Allow whitespace after the # in a directive.
This also changes a use of "\\s-" to "\\s ", because the latter form is equivalent and was used more often elsewhere in the file.
1 parent 0f65654 commit 0027f9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

csharp-mode.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ to work properly with code that includes attributes."
10541054
(save-excursion
10551055
(c-beginning-of-statement-1)
10561056
(looking-at
1057-
"#\\(pragma\\|endregion\\|region\\|if\\|else\\|endif\\)"))
1057+
"#\\s *\\(pragma\\|endregion\\|region\\|if\\|else\\|endif\\)"))
10581058
)))
10591059

10601060
(if is-attr
@@ -1155,7 +1155,7 @@ Currently handled:
11551155
(setq done t)))))))))
11561156

11571157
(goto-char beg)
1158-
(while (re-search-forward "^\\s-*#\\(region\\|pragma\\) " end t)
1158+
(while (re-search-forward "^\\s *#\\s *\\(region\\|pragma\\) " end t)
11591159
(when (looking-at "\\w")
11601160
;; mark the space separating the directive from the comment
11611161
;; text as comment starter to allow correct word movement
@@ -1403,7 +1403,7 @@ This regexp is assumed to not match any non-operator identifier."
14031403
;; Use the eval form for `font-lock-keywords' to be able to use
14041404
;; the `c-preprocessor-face-name' variable that maps to a
14051405
;; suitable face depending on the (X)Emacs version.
1406-
'(eval . (list "^\\s *\\(#pragma\\|undef\\|define\\)\\>\\(.*\\)"
1406+
'(eval . (list "^\\s *#\\s *\\(pragma\\|undef\\|define\\)\\>\\(.*\\)"
14071407
(list 1 c-preprocessor-face-name)
14081408
'(2 font-lock-string-face)))
14091409
;; There are some other things in `c-cpp-matchers' besides the

0 commit comments

Comments
 (0)