[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 8889a6a 285/496: Merge pull request #112 from u
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 8889a6a 285/496: Merge pull request #112 from uk-ar/fix-multiline-expressions |
Date: |
Sun, 29 Aug 2021 11:33:52 -0400 (EDT) |
branch: elpa/swift-mode
commit 8889a6a374f9776a756f655cfa6d3771649722dd
Merge: add2ae9 3931734
Author: Arthur Evstifeev <mail@ap4y.me>
Commit: Arthur Evstifeev <mail@ap4y.me>
Merge pull request #112 from uk-ar/fix-multiline-expressions
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 7169a3b 265/496: Fix class when empty (no insts), (continued)
- [nongnu] elpa/swift-mode 7169a3b 265/496: Fix class when empty (no insts), ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 391752f 272/496: Add test case for forward-list & backward-list, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7ffd59d 273/496: Fix forward-list test by adding brackets, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3ce22b1 275/496: Remove needless code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c40887e 276/496: Merge pull request #108 from syohex/remove-needless-code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ade8e95 277/496: Use with-eval-after-load instead of eval-after-load, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a3bcb19 278/496: Merge pull request #109 from syohex/with-eval-after-load, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3aec61f 279/496: Update Emacs version requirement in README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 6793bd9 281/496: Indent according to operators precedence, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode add2ae9 282/496: Merge pull request #111 from uk-ar/indent-according-to-prec, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 8889a6a 285/496: Merge pull request #112 from uk-ar/fix-multiline-expressions,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 064d4ee 287/496: Update acknowledgments section in readme, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b7cc115 293/496: Merge pull request #116 from syohex/use-cl-lib, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e9648b1 296/496: Use .el for file extension in distributed package., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1563e8b 300/496: Bump the development version to 0.5.0-snapshot, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a5e1acf 297/496: Merge pull request #122 from N4tr0n/make-install-fix-issue120, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cfaeaff 294/496: Update MELPA URL, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 9471669 304/496: Merge taku0/swift3-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 848d088 310/496: Fix indentation after attributes with arguments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cad72a1 306/496: Fix a link in README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0a75736 317/496: Fix indentation, ELPA Syncer, 2021/08/29