summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Gonzalez <roman@unbounce.com>2015-04-13 13:46:18 -0700
committerRoman Gonzalez <roman@unbounce.com>2015-04-13 13:46:18 -0700
commit6eea8638a104ff7e4b743cb9654c5a6f8561fc11 (patch)
tree63e639751c2cff784f6ecc9294d7478504541caa
parentaee918153b8100fbe3eca8dcc20fe8b56a656761 (diff)
Fix bug on newer version of paredit
Function got paredit-check-region got replaced in favor of paredit-check-region-for-delete
-rw-r--r--evil-paredit.el24
1 files changed, 12 insertions, 12 deletions
diff --git a/evil-paredit.el b/evil-paredit.el
index e9ead8a..49cc814 100644
--- a/evil-paredit.el
+++ b/evil-paredit.el
@@ -29,24 +29,24 @@
(evil-normal-state)
(evil-change-state prev-state)))
-(defun -evil-paredit-check-region (beginning end)
- (if (and beginning end)
- ;; Check that region begins and ends in a sufficiently similar
- ;; state, so that deleting it will leave the buffer balanced.
- (save-excursion
- (goto-char beginning)
- (let* ((state (paredit-current-parse-state))
- (state* (parse-partial-sexp beginning end nil nil state)))
- (paredit-check-region-state state state*)))))
+(defun -evil-paredit-check-region (beg end)
+ (if (fboundp 'paredit-check-region-state)
+ (if (and beg end)
+ ;; Check that region begins and ends in a sufficiently similar
+ ;; state, so that deleting it will leave the buffer balanced.
+ (save-excursion
+ (goto-char beg)
+ (let* ((state (paredit-current-parse-state))
+ (state* (parse-partial-sexp beg end nil nil state)))
+ (paredit-check-region-state state state*))))
+ (paredit-check-region-for-delete beg end)))
(evil-define-operator evil-paredit-yank (beg end type register yank-handler)
"Saves the characters in motion into the kill-ring."
:move-point nil
:repeat nil
(interactive "<R><x><y>")
- (if (fboundp 'paredit-check-region-state)
- (-evil-paredit-check-region beg end)
- (paredit-check-region-for-delete beg end))
+ (-evil-paredit-check-region beg end)
(cond
((eq type 'block)
(evil-yank-rectangle beg end register yank-handler))