[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 3931734 283/496: fix multi-line expressions
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 3931734 283/496: fix multi-line expressions |
Date: |
Sun, 29 Aug 2021 11:33:52 -0400 (EDT) |
branch: elpa/swift-mode
commit 3931734791399824eb7d929ab7bb6708aa7ab663
Author: uk-ar <yuuki.ari@gmail.com>
Commit: uk-ar <yuuki.ari@gmail.com>
fix multi-line expressions
---
swift-mode.el | 10 +++++-----
test/indentation-tests.el | 15 ++++++++++++++-
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/swift-mode.el b/swift-mode.el
index 9b74ae8..2de187e 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -408,13 +408,13 @@ We try to constraint those lookups by reasonable number
of lines.")
;; Apply swift-indent-multiline-statement-offset if
;; operator is the last symbol on the line
- (`(:before . ,(pred (lambda (token)
+ (`(:after . ,(pred (lambda (token)
(member token swift-smie--operators))))
(when (and (smie-rule-hanging-p)
- (not (apply 'smie-rule-parent-p swift-smie--operators)))
- (if (smie-rule-parent-p "{")
- (+ swift-indent-offset swift-indent-multiline-statement-offset)
- swift-indent-multiline-statement-offset)))
+ (not (apply 'smie-rule-parent-p
+ (append swift-smie--operators '("?" ":" "=")))))
+ swift-indent-multiline-statement-offset
+ ))
(`(:before . ",")
(if (and swift-indent-hanging-comma-offset (smie-rule-parent-p "class"
"case"))
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 4e01ab0..c77666b 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -1508,6 +1508,19 @@ let x = bar
|defaultValue
")
+(check-indentation indents-multiline-expressions/24
+ "
+let foo =
+ bar +
+ |baz +
+ a
+" "
+let foo =
+ bar +
+ |baz +
+ a
+")
+
(check-indentation indents-long-parameters/1
"
func foo() {
@@ -1619,7 +1632,7 @@ let options = NSRegularExpressionOptions.CaseInsensitive &
|NSRegularExpressionOptions.DotMatchesLineSeparators
" "
let options = NSRegularExpressionOptions.CaseInsensitive &
- |NSRegularExpressionOptions.DotMatchesLineSeparators
+ |NSRegularExpressionOptions.DotMatchesLineSeparators
"
((swift-indent-multiline-statement-offset 4)))
- [nongnu] elpa/swift-mode 7a7038b 202/496: Remove supported for trailing dot in multi-line expression (invalid, (continued)
- [nongnu] elpa/swift-mode 7a7038b 202/496: Remove supported for trailing dot in multi-line expression (invalid, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d27b851 181/496: Add indentation rules for ternary operator, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3026464 206/496: Merge pull request #79 from dougbeal/fix-custom-types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ae4f08b 253/496: Correct implicit semicolon rule for in keyword, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3aa3dcd 254/496: Add test code for checking tokens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b97b570 260/496: Fix indent rule for '(' and pass all test, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 00393f7 262/496: Merge pull request #103 from uk-ar/fix-lexer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ed1ed46 264/496: Add test for forward-sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a3377bf 266/496: Fix forward-sexp test by adding brackets, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 228b50c 267/496: Fix case-: for multiline case-exps, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3931734 283/496: fix multi-line expressions,
ELPA Syncer <=
- [nongnu] elpa/swift-mode e5b569e 284/496: Add keyword for attribute, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d614017 298/496: Update copyright years, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 174bccc 309/496: Tweak .travis.yml, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f9f4bc5 311/496: Fix `beginning/end-of-defun`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c659c45 329/496: Highlight anchor point for debugging., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b6512fa 325/496: Fix indentation of attributes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1d43501 330/496: Fix indentation of attributes at begging of the buffer., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 193de68 327/496: Fix end-of-defun at eob, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a07be7a 335/496: Fix `swift-mode:beginning-of-defun`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f03db1a 331/496: Fix indentation of switch., ELPA Syncer, 2021/08/29