Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix evil-cp-up-sexp getting stuck on closing quote #111

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion evil-cleverparens-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,15 @@ golf foxtrot deltahotel india"))
"alpha[ ]bravo"
(evil-cp-set-additional-movement-keys)
(")")
"alpha[ ]bravo")))
"alpha[ ]bravo"))
(ert-info ("Move if on quote")
(evil-cp-test-buffer
"(alpha (bravo \"char[l]ie\" delta) echo)"
(evil-cp-set-additional-movement-keys)
(")")
"(alpha (bravo \"charlie[\"] delta) echo)"
(")")
"(alpha (bravo \"charlie\" delta[)] echo)")))

(ert-deftest evil-cp-forward-symbol-begin-test ()
(ert-info ("Can move forward to the beginning of the next symbol")
Expand Down
4 changes: 2 additions & 2 deletions evil-cleverparens.el
Original file line number Diff line number Diff line change
Expand Up @@ -930,14 +930,14 @@ evil-motion."
(sp-backward-up-sexp))))

(evil-define-motion evil-cp-up-sexp (count)
"Motion for moving up to the previous level of parenteheses.
"Motion for moving up to the previous level of parentheses.
The same as `sp-up-sexp', but leaves the point on top of the
closing paren."
:move-point nil
:type inclusive
(let ((count (or count 1))
success)
(when (evil-cp--looking-at-closing-p) (forward-char))
(when (evil-cp--looking-at-any-closing-p) (forward-char))
(dotimes (_ count)
(and (sp-up-sexp) (setq success t)))
(and success (backward-char))))
Expand Down