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

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

[nongnu] elpa/swift-mode 835c3d3 132/496: Merge pull request #40 from ap


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 835c3d3 132/496: Merge pull request #40 from ap4y/improve_37
Date: Sun, 29 Aug 2021 11:33:22 -0400 (EDT)

branch: elpa/swift-mode
commit 835c3d3f524325789256d9abfde9152be277a073
Merge: abd6e07 2593659
Author: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>

    Merge pull request #40 from ap4y/improve_37
    
    Improve indentation for multi-line dot expression with dot positioned on 
the second line
---
 swift-mode.el             |  2 +-
 test/indentation-tests.el | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/swift-mode.el b/swift-mode.el
index bc96468..adea3e9 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -187,7 +187,7 @@
 (defun swift-smie--implicit-semi-p ()
   (save-excursion
     (not (or (memq (char-before) '(?\{ ?\[ ?, ?.))
-             (memq (char-after (+(point) 1)) '(?.))
+             (looking-at "[ \n\t]+[.]")
              (looking-back swift-smie--operators-regexp (- (point) 3) t)
              ))))
 
diff --git a/test/indentation-tests.el b/test/indentation-tests.el
index 3b1c14f..d5dc4b4 100644
--- a/test/indentation-tests.el
+++ b/test/indentation-tests.el
@@ -792,6 +792,24 @@ let json_ary = NSJSONSerialization
                |.JSONObjectWithData(data, options: nil, error: &json_err) as 
NSArray
 ")
 
+(check-indentation indents-multiline-expressions/6
+                   "
+let json_ary = NSJSONSerialization.
+               |JSONObjectWithData(data, options: nil, error: &json_err) as 
NSArray
+" "
+let json_ary = NSJSONSerialization.
+               |JSONObjectWithData(data, options: nil, error: &json_err) as 
NSArray
+")
+
+(check-indentation indents-multiline-expressions/7
+                   "
+let json_ary = NSJSONSerialization
+               |.JSONObjectWithData(data, options: nil, error: &json_err) as 
NSArray
+" "
+let json_ary = NSJSONSerialization
+               |.JSONObjectWithData(data, options: nil, error: &json_err) as 
NSArray
+")
+
 (check-indentation indents-type-annotations/1
                    "
 typealias Foo = Bar<Foo.Baz, Foo>



reply via email to

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