[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 5e47b77 260/459: Fix error handling multili
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 5e47b77 260/459: Fix error handling multiline compiler-directives. |
Date: |
Sun, 22 Aug 2021 13:59:40 -0400 (EDT) |
branch: externals/csharp-mode
commit 5e47b7764b3f4c97c260a902e8072d444dbd0f1b
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Fix error handling multiline compiler-directives.
Caused by changes upstream in cc-mode.
Fix by copying removed functions locally.
---
csharp-mode.el | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/csharp-mode.el b/csharp-mode.el
index d039313..feaf68b 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -756,8 +756,9 @@ to work properly with code that includes attributes."
;; Match a char before the string starter to make
;; `c-skip-comments-and-strings' work correctly.
(concat ".\\(" c-string-limit-regexp "\\)")
- '((when (fboundp 'c-font-lock-invalid-string)
- (c-font-lock-invalid-string))))
+ '((if (fboundp 'c-font-lock-invalid-string)
+ (c-font-lock-invalid-string)
+ (csharp-mode-font-lock-invalid-string))))
;; Fontify keyword constants.
@@ -2471,6 +2472,36 @@ are the string substitutions (see `format')."
;; these defuns.
;;
+;; verabatim copy of c-font-lock-invalid-string before it was removed
+;; from emacs/cc-mode in Git commit bb591f139f0602af292c772f974dcc14dabb1deb.
+
+(defun csharp-mode-font-lock-invalid-string ()
+ ;; Assuming the point is after the opening character of a string,
+ ;; fontify that char with `font-lock-warning-face' if the string
+ ;; decidedly isn't terminated properly.
+ ;;
+ ;; This function does hidden buffer changes.
+ (let ((start (1- (point))))
+ (save-excursion
+ (and (eq (elt (parse-partial-sexp start (c-point 'eol)) 8) start)
+ (if (if (eval-when-compile (integerp ?c))
+ ;; Emacs
+ (integerp c-multiline-string-start-char)
+ ;; XEmacs
+ (characterp c-multiline-string-start-char))
+ ;; There's no multiline string start char before the
+ ;; string, so newlines aren't allowed.
+ (not (eq (char-before start) c-multiline-string-start-char))
+ ;; Multiline strings are allowed anywhere if
+ ;; c-multiline-string-start-char is t.
+ (not c-multiline-string-start-char))
+ (if c-string-escaped-newlines
+ ;; There's no \ before the newline.
+ (not (eq (char-before (point)) ?\\))
+ ;; Escaped newlines aren't supported.
+ t)
+ (c-put-font-lock-face start (1+ start) 'font-lock-warning-face)))))
+
(defun c-looking-at-inexpr-block (lim containing-sexp &optional check-at-end)
;; Return non-nil if we're looking at the beginning of a block
;; inside an expression. The value returned is actually a cons of
- [elpa] externals/csharp-mode 166a5fb 340/459: Revert "Handle "nameof" entirely in c-basic-matchers-after.", (continued)
- [elpa] externals/csharp-mode 166a5fb 340/459: Revert "Handle "nameof" entirely in c-basic-matchers-after.", ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1e7bf8a 358/459: Update build.yml, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a685c7f 359/459: Update build.yml, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e2541a4 362/459: Update README.org, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c1489db 370/459: First small tree-sitter query, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2bf76fd 378/459: Fix csharp-mode initialization without forked tree-sitter, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7e7353a 133/459: Imenu fixes: methods with comments, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1de5644 227/459: using: Don't mess up alnums in indentifier-fontification., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8d43a70 229/459: Fix fontification of using-statements., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4da4c39 231/459: Fix fontification of namespaces to match using-statement rules., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5e47b77 260/459: Fix error handling multiline compiler-directives.,
ELPA Syncer <=
- [elpa] externals/csharp-mode 20efdc8 262/459: Add support for highlighting function-invocation., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d365498 307/459: Merge pull request #170 from josteink/compiler-fontifications, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 72c1912 314/459: Name change of codedoc functions, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ecc3f38 317/459: Add annotation-top-cont as a new syntax construct, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 51ab628 319/459: Update README.org, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode be5af57 322/459: Fix optional type suffix regex, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 217d3a7 324/459: Revert "Add nullable operator to concatenated identifiers", ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 97903a2 327/459: Merge pull request #179 from josteink/feature/compilation-mode-dotnetcore, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c44989a 331/459: Merge pull request #183 from josteink/vscode-fontification, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2697c95 332/459: Move bobp checking in one level, ELPA Syncer, 2021/08/22