Permalink
Browse files

lispy.el (lispy-kill): Fixup

* lispy-test.el (lispy-kill): Add test.

Fixes #326
  • Loading branch information...
1 parent 88133cb commit 23b5719e92f4f95ea17499bb97143199c2acaff3 @abo-abo committed Jan 9, 2017
Showing with 9 additions and 3 deletions.
  1. +4 −1 lispy-test.el
  2. +5 −2 lispy.el
View
@@ -566,7 +566,10 @@ Insert KEY if there's no command."
"(progn\n|\n (new-code))"))
(should (equal (lispy-with "(progn\n |\"test\" \n (bar))"
"\C-k")
- "(progn\n |\n (bar))")))
+ "(progn\n |\n (bar))"))
+ (should (equal (lispy-with "(progn\n| \"docs\" ;; 0\n (one) ;; 1\n )"
+ "\C-k")
+ "(progn\n|\n (one) ;; 1\n )")))
(ert-deftest lispy-yank ()
(should (string= (lispy-with "\"|\"" (kill-new "foo") (lispy-yank))
View
@@ -987,12 +987,15 @@ If position isn't special, move to previous or error."
(kill-region (point) pt))))
(t
(let ((beg (point))
- (end (line-end-position)))
+ (end (line-end-position))
+ bnd)
(while (and (< (point) end)
(ignore-errors
(forward-sexp 1)
(skip-chars-forward " ")
- t)))
+ t))
+ (when (setq bnd (lispy--bounds-comment))
+ (goto-char (cdr bnd))))
(skip-chars-forward " \t")
(kill-region beg (point)))))))

0 comments on commit 23b5719

Please sign in to comment.