branch: elpa/why-this commit d8db9e63e077f55aaffe6c707fa6917c31994aa8 Author: Akib Azmain Turja <a...@disroot.org> Commit: Akib Azmain Turja <a...@disroot.org>
Fix overlay moving code and a typo in global-why-this-mode --- why-this.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/why-this.el b/why-this.el index 49c6b1852e..67b7827ced 100644 --- a/why-this.el +++ b/why-this.el @@ -269,14 +269,12 @@ When EXACT is non-nil, be as exact as possible." (< line end) (eq line (overlay-get (car ov) 'why-this-line))))) (progn - (let ((ov-start (overlay-start (car ov)))) - (when (and (eq (line-number-at-pos) - (line-number-at-pos ov-start)) - (> (point) ov-start)) - (let ((pos (save-excursion - (goto-char ov-start) - (line-end-position)))) - (move-overlay (car ov) pos pos)))) + (let* ((ov-start (overlay-start (car ov))) + (pos (save-excursion + (goto-char ov-start) + (line-end-position)))) + (unless (eq ov-start pos) + (move-overlay (car ov) pos pos))) ov) (delete-overlay (car ov)) nil)) @@ -465,7 +463,7 @@ Actually the supported backend is returned." ;;;###autoload (define-globalized-minor-mode global-why-this-mode why-this-mode - #'why-this-mode) + why-this-mode) (define-derived-mode why-this-annotate-mode special-mode "Why-This-Annotate"