Skip to content

Commit

Permalink
[Fix #696] Reindent in js2-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuco1 committed Jul 13, 2017
1 parent 9cff71a commit 05b42a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cask
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
(depends-on "auctex")
(depends-on "clojure-mode")
(depends-on "lua-mode")
(depends-on "js2-mode")
(depends-on "ess")
(depends-on "tuareg")
(depends-on "scala-mode")
Expand Down
1 change: 0 additions & 1 deletion smartparens.el
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ Symbol is defined as a chunk of text recognized by
(defcustom sp-no-reindent-after-kill-modes '(
python-mode
coffee-mode
js2-mode
asm-mode
makefile-gmake-mode
)
Expand Down
14 changes: 14 additions & 0 deletions test/smartparens-javascript-test.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(require 'ert)
(require 'smartparens-javascript)
(require 'js2-mode)

(defun sp-test--javascript-mode ()
"Helper"
Expand All @@ -12,3 +13,16 @@
(sp-forward-slurp-sexp)
(sp-forward-slurp-sexp)
(should (equal (buffer-string) "(foo.bar)()"))))

(ert-deftest sp-test-js2-reindent-after-kill ()
(sp-test-with-temp-buffer "function f () {
|
return 42; // 2 spaces of indentation
}
"
(shut-up (js2-mode))
(sp-kill-hybrid-sexp 1)
(sp-buffer-equals "function f () {
|return 42; // 2 spaces of indentation
}
")))

0 comments on commit 05b42a2

Please sign in to comment.