Skip to content

Commit bfbf132

Browse files
committed
lispy.el (lispy-delete-backward): fix
* lispy-test.el (lispy-delete-backward): Add test.
1 parent 1c898ac commit bfbf132

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lispy-test.el

+3-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,9 @@ Insert KEY if there's no command."
460460
(should (string= (lispy-with "(list\n (foo)\n |(bar))" "\C-?")
461461
"(list\n (foo) |(bar))"))
462462
(should (string= (lispy-with "(list\n (foo)\n |\"bar\")" "\C-?")
463-
"(list\n (foo) |\"bar\")")))
463+
"(list\n (foo) |\"bar\")"))
464+
(should (string= (lispy-with " |(foo)" "\C-?")
465+
"|(foo)")))
464466

465467
(ert-deftest lispy-pair ()
466468
(should (string= (lispy-with "\"\\\\|\"" "(")

lispy.el

+3-1
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,10 @@ Otherwise (`backward-delete-char-untabify' ARG)."
913913

914914
((looking-back "^ *")
915915
(delete-region
916-
(1- (line-beginning-position))
916+
(line-beginning-position)
917917
(point))
918+
(unless (bobp)
919+
(backward-delete-char 1))
918920
(unless (or (eolp)
919921
(looking-at lispy-right))
920922
(just-one-space))

0 commit comments

Comments
 (0)