[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 67fd6a9 160/496: Fix indentation of multiline o
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 67fd6a9 160/496: Fix indentation of multiline operator expressions |
Date: |
Sun, 29 Aug 2021 11:33:28 -0400 (EDT) |
branch: elpa/swift-mode
commit 67fd6a9ada58f33c87445901561ad2e7fd475ecf
Author: Christian Kruse <cjk@defunct.ch>
Commit: Christian Kruse <cjk@defunct.ch>
Fix indentation of multiline operator expressions
Expressions with multiple operators over multiple lines got indented one
offset deeper per line break. An additional smie check for being a
sibling should fix this problem.
---
swift-mode.el | 3 ++-
test/indentation-tests.el | 13 +++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/swift-mode.el b/swift-mode.el
index 449d134..2602d26 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -286,7 +286,8 @@
;; Apply swift-indent-multiline-statement-offset if
;; operator is the last symbol on the line
(`(:before . "OP")
- (if (looking-at ".[\n]")
+ (if (and (looking-at ".[\n]")
+ (not (smie-rule-sibling-p)))
(smie-rule-parent swift-indent-multiline-statement-offset)))
;; Indent second line of the multi-line class
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 1c4b1fb..cb810b1 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -919,6 +919,19 @@ let foo = bar >
|baz
")
+(check-indentation indents-multiline-operators-only-once
+ "
+1 +
+ 2 + 5 *
+|3
+" "
+1 +
+ 2 + 5 *
+ |3
+"
+)
+
+
(provide 'indentation-tests)
;;; indentation-tests.el ends here
- [nongnu] elpa/swift-mode 5aa4010 082/496: Replace if not with unless, (continued)
- [nongnu] elpa/swift-mode 5aa4010 082/496: Replace if not with unless, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3a82dd5 085/496: Add mode menu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 32e08b3 095/496: Add initial implementation of smie based indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b1334e1 101/496: Highlight interpolation expression via syntactic fontification, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d053d31 109/496: Use greedy regex in interpolation highlighting to prevent issues with, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ecb8a87 114/496: Use different lexer rule for case statement in enum to fix issues with, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 27b93dd 126/496: Merge pull request #34 from ap4y/string_interpolation_improvements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c08c3a1 138/496: Define dot-exp smie rule as combination of ids rather than expressions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b5bfbe0 154/496: Don't active flycheck checker by default, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c73d653 151/496: Use correct function from cl-lib, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 67fd6a9 160/496: Fix indentation of multiline operator expressions,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 4b6d6f1 162/496: Add ckruse to the Acknowledgements in README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5675e1f 167/496: Merge pull request #65 from ckruse/fix_64, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 94d687d 173/496: Add required ELPA source, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 302e83d 194/496: Distinct generic type parameter from ">" operator when checking for, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 73cdda9 195/496: Don't put implicit semicolon after "(", ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5c31636 200/496: Treat default token as case token, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4ab5f7f 201/496: Add implicit semicolon rule for ?? operator, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode fd228c0 203/496: Improve lexer rule for disctinction between case in switch and enum, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1122ab9 204/496: Add grammar rule for return statement in function, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f193a82 205/496: defcustom types for swift-indent was incorrectly set to intergerp, ELPA Syncer, 2021/08/29