emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/swift-mode 228b50c 267/496: Fix case-: for multiline case-


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 228b50c 267/496: Fix case-: for multiline case-exps
Date: Sun, 29 Aug 2021 11:33:48 -0400 (EDT)

branch: elpa/swift-mode
commit 228b50c8e42459f4bdb356d6fd021d0de47d7d31
Author: uk-ar <yuuki.ari@gmail.com>
Commit: uk-ar <yuuki.ari@gmail.com>

    Fix case-: for multiline case-exps
---
 swift-mode.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/swift-mode.el b/swift-mode.el
index a695e5b..dfc82bb 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -286,7 +286,8 @@ We try to constraint those lookups by reasonable number of 
lines.")
 
    ((looking-at ",") (forward-char 1) ",")
    ((looking-at ":") (forward-char 1)
-    (if (looking-back "\\(case [^:]+\\|default\\):" (line-beginning-position 
0) t)
+    ;; look-back until "case", ":", "{", ";"
+    (if (looking-back "case[\n\t ][^:{;]+:")
         "case-:"
       ":"))
 
@@ -341,7 +342,8 @@ We try to constraint those lookups by reasonable number of 
lines.")
 
      ((eq (char-before) ?,) (backward-char 1) ",")
      ((eq (char-before) ?:) (backward-char 1)
-      (if (looking-back "case [^:]+\\|default" (line-beginning-position 0))
+      ;; look-back until "case", ":", "{", ";"
+      (if (looking-back "case[\n\t ][^:{;]+")
           "case-:"
         ":"))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]