summaryrefslogtreecommitdiff
path: root/paredit.el
diff options
context:
space:
mode:
Diffstat (limited to 'paredit.el')
-rw-r--r--paredit.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/paredit.el b/paredit.el
index 22927bf..23acb5f 100644
--- a/paredit.el
+++ b/paredit.el
@@ -1778,13 +1778,15 @@ With a prefix argument N, encompass all N S-expressions forward."
'paredit-up/down)))))
(defun paredit-find-next-string-start (horizontal-direction limit)
- (let ((next-char (if (< 0 horizontal-direction) 'char-after 'char-before))
- (pastp (if (< 0 horizontal-direction) '< '>)))
+ (let ((buffer-limit-p (if (< 0 horizontal-direction) 'eobp 'bobp))
+ (next-char (if (< 0 horizontal-direction) 'char-after 'char-before))
+ (pastp (if (< 0 horizontal-direction) '> '<)))
(paredit-handle-sexp-errors
(save-excursion
(catch 'exit
(while t
- (if (and limit (funcall pastp (point) limit))
+ (if (or (funcall buffer-limit-p)
+ (and limit (funcall pastp (point) limit)))
(throw 'exit nil))
(forward-sexp horizontal-direction)
(save-excursion