branch: elpa/swift-mode commit 228b50c8e42459f4bdb356d6fd021d0de47d7d31 Author: uk-ar <yuuki....@gmail.com> Commit: uk-ar <yuuki....@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-:" ":"))