branch: elpa/dart-mode
commit d5776f1e9bfeb45eb30723eba3030691a8491545
Author: Brady Trainor <[email protected]>
Commit: Brady Trainor <[email protected]>

    Fixes fontification of small strings containing only backslashes
---
 dart-mode.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dart-mode.el b/dart-mode.el
index 8406b0f..a75b1fc 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -737,9 +737,10 @@ strings."
       (put-text-property bos (1+ bos) 'syntax-table (string-to-syntax "|") nil)
       ;; Look for the end of string delimiter, depending on rawp and
       ;; string-delimiter
-      (when (or (looking-at string-delimiter)
-                ;; Unless rawp, ensure an even number of backslashes
-                (re-search-forward (concat (if rawp "" (rx (not (any ?\\)) 
(zero-or-more ?\\ ?\\)))
+      ;; Unless rawp, ensure an even number of backslashes
+      (when (or (looking-at (concat (unless rawp (rx (zero-or-more ?\\ ?\\)))
+                                    string-delimiter))
+                (re-search-forward (concat (unless rawp (rx (not (any ?\\)) 
(zero-or-more ?\\ ?\\)))
                                            string-delimiter)
                                    end t))
         (let ((eos (match-end 0)))

Reply via email to