[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 4ae6cc2 228/496: Fix indent when after comment
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 4ae6cc2 228/496: Fix indent when after comment |
Date: |
Sun, 29 Aug 2021 11:33:41 -0400 (EDT) |
branch: elpa/swift-mode
commit 4ae6cc2e4ffebce9070f0fa96dacc8ecf7661e92
Author: uk-ar <yuuki.ari@gmail.com>
Commit: uk-ar <yuuki.ari@gmail.com>
Fix indent when after comment
---
swift-mode.el | 5 ++++-
test/indentation-tests.el | 15 +++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/swift-mode.el b/swift-mode.el
index bceab2a..2f61945 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -225,7 +225,10 @@
(looking-at "[ \n\t]+[.?:]")
;; Operators placed on the second line in multi-line expression
;; Should respect here possible comments strict before the
linebreak
- (looking-at (concat "\\(\/\/.*\\)?\n[[:space:]]*"
swift-smie--operators-regexp))
+ (and (looking-at
+ (concat "\\(\/\/.*\\)?\n[[:space:]]*"
swift-smie--operators-regexp))
+ (not (looking-at
+ (concat "\\(\/\/.*\\)?\n[[:space:]]*" "//"))))
(and (looking-back swift-smie--operators-regexp (- (point) 3) t)
;; Not a generic type
(not (looking-back "[[:upper:]]>" (- (point) 2) t)))
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 8be3235..1226198 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -2009,6 +2009,21 @@ func foo() {
}
")
+(check-indentation indents-expression-with-comment/3
+ "
+func foo() {
+ foo()
+ //
+ |foo()
+}
+" "
+func foo() {
+ foo()
+ //
+ |foo()
+}
+")
+
(provide 'indentation-tests)
;;; indentation-tests.el ends here
- [nongnu] elpa/swift-mode 3298fb1 169/496: Stop overriding user preferences for tab-width., (continued)
- [nongnu] elpa/swift-mode 3298fb1 169/496: Stop overriding user preferences for tab-width., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0808a2b 170/496: Add font-lock rules for access modifier keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 52045f0 174/496: Fix issues with several failing tests on emacs 24.4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 230afd3 175/496: Setup travis matrix with emacs 24.3 and 24.4., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5fabebd 196/496: Improve indentation rules for function arguments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 38933b9 208/496: Don't use implicit semicolon when operator is placed on the second line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d0c65bc 212/496: Fix bug with the closing parentheses in method calls and function, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 107195e 219/496: Improve lexer rule for generics with optional or implicit unwrapping, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cdf7ad4 220/496: Fix indentation issues with deep nested if cluase, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 9941c27 224/496: Bring failing tests for #81 contributed in #82 by @dougbeal, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4ae6cc2 228/496: Fix indent when after comment,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 68a3a29 231/496: Support for choosing framework search paths., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 8e0f8d6 240/496: Merge pull request #94 from wiruzx/new-range-operator, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 17bf117 242/496: Merge pull request #95 from wiruzx/add-as!-operator, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b3af0b0 252/496: Constraint all look backs to the reasonable amount of lines, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 52a01b1 269/496: Add test case for backward-sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5c09b07 289/496: Merge pull request #114 from uk-ar/fix-indent-for-ternary-operator, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4e9da69 299/496: Release 0.4.0, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c303245 291/496: Merge pull request #115 from uk-ar/add-melpa-badge, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 9211980 312/496: Bump version to 2.1.2, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3d27871 313/496: Tweak README.md, ELPA Syncer, 2021/08/29