[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode c314c65 157/459: Highlight text after #regi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode c314c65 157/459: Highlight text after #region or #pragma as comment |
Date: |
Sun, 22 Aug 2021 13:59:17 -0400 (EDT) |
branch: externals/csharp-mode
commit c314c65da0f208badbb46ef596774e0bd4decdbd
Author: Vasilij Schneidermann <v.schneidermann@gmail.com>
Commit: Vasilij Schneidermann <v.schneidermann@gmail.com>
Highlight text after #region or #pragma as comment
Closes #69
---
csharp-mode.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/csharp-mode.el b/csharp-mode.el
index fbdcb4b..060dcde 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -1132,7 +1132,14 @@ a square parentasis block [ ... ]."
))
-
+(defun csharp-mode-syntax-propertize-function (beg end)
+ "Highlight text after #region or #pragma as comment."
+ (save-excursion
+ (goto-char beg)
+ (while (re-search-forward "^\\s-*#\\(region\\|pragma\\) " end t)
+ (when (looking-at "\\w")
+ (put-text-property (point) (1+ (point))
+ 'syntax-table (string-to-syntax "< b"))))))
;; C# does generics. Setting this to t tells the parser to put
;; parenthesis syntax on angle braces that surround a comma-separated
@@ -4239,12 +4246,6 @@ Key bindings:
;; define underscore as part of a word in the Csharp syntax table
(modify-syntax-entry ?_ "w" csharp-mode-syntax-table)
- ;; ensure #region and #pragma directives are not treated as computational
- ;; expressions and thus wont have string and character rules applied to
- ;; them.
- (modify-syntax-entry ?# "< b" csharp-mode-syntax-table)
- (modify-syntax-entry ?\n "> b" csharp-mode-syntax-table)
-
;; define @ as an expression prefix in Csharp syntax table
(modify-syntax-entry ?@ "'" csharp-mode-syntax-table)
@@ -4313,7 +4314,10 @@ Key bindings:
(setq beginning-of-defun-function 'csharp-move-back-to-beginning-of-defun)
;; `end-of-defun-function' can remain forward-sexp !!
- (set (make-local-variable 'comment-auto-fill-only-comments) t))
+ (set (make-local-variable 'comment-auto-fill-only-comments) t)
+
+ (set (make-local-variable 'syntax-propertize-function)
+ 'csharp-mode-syntax-propertize-function))
(provide 'csharp-mode)
- [elpa] externals/csharp-mode 9e78a26 128/459: Derive from prog-mode, (continued)
- [elpa] externals/csharp-mode 9e78a26 128/459: Derive from prog-mode, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6e3cdc1 129/459: Add a regression test, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0a61f21 131/459: Bump version., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f367ef6 135/459: Cleanup test-code for imenu-fixes., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8ec64b4 136/459: Merge pull request #57 from josteink/imenu-fixes, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8c5bae2 139/459: Fixup, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d0d7ec3 140/459: Merge pull request #58 from josteink/compilation-mode-fixes, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 49f7342 148/459: Make future editing sane., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ffe87f9 150/459: Tests: refactor imenu-tests, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b4fb58a 153/459: Update changelog., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c314c65 157/459: Highlight text after #region or #pragma as comment,
ELPA Syncer <=
- [elpa] externals/csharp-mode 60e8171 159/459: Start update changelog and prepare for new version., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8aeb816 164/459: Fix compiler warnings., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 775fafd 166/459: Make assess-package available for testing., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode acaa9bb 169/459: Make another fontification-test assess-based., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b1e237d 172/459: Add tests, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c4a2dfd 176/459: Fixup tests., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4f151a1 177/459: Fix CI by fixing byte-compilation., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4cd07f9 178/459: Clean up fontification test., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 69d95d2 179/459: Make tests less noisy., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3c1143d 180/459: Merge branch 'fix-verbatim-string-literals', ELPA Syncer, 2021/08/22