[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/smartparens be3f1de 3/4: Merge pull request #1102 from Vla
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/smartparens be3f1de 3/4: Merge pull request #1102 from VlachJosef/master |
Date: |
Mon, 1 Nov 2021 06:58:03 -0400 (EDT) |
branch: elpa/smartparens
commit be3f1de770a76e335177ecefa9952fd8019a950b
Merge: 2834c66 1ebf53b
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #1102 from VlachJosef/master
---
smartparens-scala.el | 1 +
test/smartparens-scala-test.el | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/smartparens-scala.el b/smartparens-scala.el
index 7b37472..96f8c7e 100644
--- a/smartparens-scala.el
+++ b/smartparens-scala.el
@@ -56,6 +56,7 @@
(defun sp-scala-wrap-with-indented-newlines (_1 action _2)
"Post handler for the wrap ACTION, putting the region on indented newlines."
(when (eq action 'wrap)
+ (indent-for-tab-command)
(sp-get sp-last-wrapped-region
(let ((beg :beg-in)
(end :end-in))
diff --git a/test/smartparens-scala-test.el b/test/smartparens-scala-test.el
index 5c669f5..51ba7cc 100644
--- a/test/smartparens-scala-test.el
+++ b/test/smartparens-scala-test.el
@@ -44,6 +44,13 @@
(execute-kbd-macro "{")
(should (equal (buffer-string) "{\n foo\n}"))))
+(ert-deftest sp-test-scala-curly-wrap-indent ()
+ "Wrap an indented region in an indented block"
+ (sp-test-with-temp-buffer "if (true)\n |fooM"
+ (scala-mode)
+ (execute-kbd-macro "{")
+ (should (equal (buffer-string) "if (true)\n{\n foo\n}"))))
+
(ert-deftest sp-test-scala-triple-quotes ()
"Close triple quotes"
(sp-test-with-temp-buffer "sql|"