Skip to content

Commit

Permalink
Fix dd issue
Browse files Browse the repository at this point in the history
Correctly handle case where there is an unmatched closing delimiter on
the current line and a sexp on the next line. Fixes #34.
  • Loading branch information
noctuid committed Feb 28, 2018
1 parent d99f08d commit b429185
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lispyville-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ character after it is not considered as part of the region."
(should (string= (lispyville-with "((\n |(a b)))\n"
"dd")
"((\n |))")))
;; sexp after closing
(should (string= (lispyville-with "(let ((a 1)\n |(b 2))\n (foo a b))"
"dd")
"(let ((a 1))\n |(foo a b))"))
;; after deletion, at opening delimiter(s)
(should (string= (lispyville-with "|(a b\n c)"
"dd")
Expand Down
4 changes: 3 additions & 1 deletion lispyville.el
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ This is not like the default `evil-yank-line'."
(goto-char (line-end-position))
(not (lispy--in-comment-p))))
(join-line)
(evil-insert-newline-below))
(while (progn (forward-char)
(lispyville--at-right-p)))
(newline-and-indent))
;; fix indentation (when closing delimiter(s) on empty line)
(lispy--indent-for-tab)
(when (lispyville--at-left-p)
Expand Down

0 comments on commit b429185

Please sign in to comment.