emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/swift-mode b0f5d13 113/496: Make commas non sticky, fixes


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode b0f5d13 113/496: Make commas non sticky, fixes indentation issues with optionals and
Date: Sun, 29 Aug 2021 11:33:18 -0400 (EDT)

branch: elpa/swift-mode
commit b0f5d13232c1ec1cf3d0f786f33224f5ed44d778
Author: ap4y <lod@pisem.net>
Commit: ap4y <lod@pisem.net>

    Make commas non sticky, fixes indentation issues with optionals and
    implicit unwrapping
---
 swift-mode.el             |  2 ++
 test/indentation-tests.el | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/swift-mode.el b/swift-mode.el
index d094cbf..efea369 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -194,6 +194,7 @@
     ";")
    ((looking-at "{") (forward-char 1) "{")
    ((looking-at "}") (forward-char 1) "}")
+   ((looking-at ",") (forward-char 1) ",")
    ((looking-at "<") (forward-char 1)
     (if (looking-at "[[:upper:]]") "<T" "OP"))
    ((looking-at ">") (forward-char 1)
@@ -213,6 +214,7 @@
       ";")
      ((eq (char-before) ?\{) (backward-char 1) "{")
      ((eq (char-before) ?\}) (backward-char 1) "}")
+     ((eq (char-before) ?,) (backward-char 1) ",")
      ((eq (char-before) ?<) (backward-char 1)
       (if (looking-at "<[[:upper:]]") "<T" "OP"))
      ((eq (char-before) ?>) (backward-char 1)
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 3d35adf..a9bfaf0 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -741,6 +741,24 @@ Foo.bar([
 ])
 ")
 
+(check-indentation indents-multiline-expressions/2
+                   "
+Foo.bar(bar!,
+|baz)
+" "
+Foo.bar(bar!,
+        |baz)
+")
+
+(check-indentation indents-multiline-expressions/3
+                   "
+Foo.bar(bar?,
+|baz)
+" "
+Foo.bar(bar?,
+        |baz)
+")
+
 (check-indentation indents-type-annotations/1
                    "
 typealias Foo = Bar<Foo.Baz, Foo>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]