diff options
| author | Philip Kaludercic <philipk@posteo.net> | 2023-09-22 12:18:25 +0200 |
|---|---|---|
| committer | Philip Kaludercic <philipk@posteo.net> | 2023-09-22 12:18:25 +0200 |
| commit | 9f59dd6520f4417bd50efe32f4f35ecfc6bbea17 (patch) | |
| tree | 92961698039a8f12c0dbec65fcc99d0e94637792 | |
| parent | b63e279932a799e6177a644dc4a2dfc4d9d6f089 (diff) | |
Improve navigation when not on a thing
| -rw-r--r-- | do-at-point.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/do-at-point.el b/do-at-point.el index ae6a5e4..4911af8 100644 --- a/do-at-point.el +++ b/do-at-point.el @@ -328,18 +328,18 @@ instead." "Move focus N things ahead. By default, this will move one thing ahead." (interactive "p") - (when (and do-at-point--overlay - (overlay-end do-at-point--overlay)) - (goto-char (overlay-end do-at-point--overlay)) + (when do-at-point--overlay + (when (overlay-end do-at-point--overlay) + (goto-char (overlay-end do-at-point--overlay))) (forward-thing (overlay-get do-at-point--overlay 'do-at-point-thing) n))) (defun do-at-point-backward (n) "Move focus N things back. Refer to the command `do-at-point-forward' for more details." (interactive "p") - (when (and do-at-point--overlay - (overlay-start do-at-point--overlay)) - (goto-char (overlay-start do-at-point--overlay)) + (when do-at-point--overlay + (when (overlay-start do-at-point--overlay) + (goto-char (overlay-start do-at-point--overlay))) (forward-thing (overlay-get do-at-point--overlay 'do-at-point-thing) (- (or n 1))))) |
