branch: externals/objed commit 71dc16867945581d661d183a04b87e4f7cdf990f Author: Clemens Radermacher <clem...@posteo.net> Commit: Clemens Radermacher <clem...@posteo.net>
Fix skipping object when one char before it --- objed-objects.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/objed-objects.el b/objed-objects.el index e9ddb4f..d2f415d 100644 --- a/objed-objects.el +++ b/objed-objects.el @@ -792,9 +792,13 @@ objects can throw an error." (let ((f (if dir '> '<)) (step (if dir -1 1))) (unless (funcall stop) - (forward-char step) (let ((pos (point))) (objed--object darg) + ;; if point has not moved + ;; fallback to move one char + ;; in right direction + (when (= (point) pos) + (forward-char step)) ;; check for valid move direction to avoid inf. loop if ;; the code of object misbehaves (when (funcall f (point) pos) @@ -2622,7 +2626,6 @@ non-nil the indentation block can contain empty lines." (objed-define-object nil error :get-obj (objed--get-error-bounds) - ;; TODO: search for next same face as current... :try-next (objed--next-error) :try-prev