From 77bc927b3dbb7c97463815b5e03084cf47c57adf Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 7 Jan 2023 09:44:14 +1100 Subject: tl--action-success: only move point if it was on byline FIX #326 --- lisp/mastodon-toot.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 3406ec4..56ad4ed 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -285,7 +285,8 @@ modified. Remove MARKER if REMOVE is non-nil, otherwise add it." (let ((inhibit-read-only t) (bol (car byline-region)) - (eol (cdr byline-region))) + (eol (cdr byline-region)) + (at-byline-p (eq (get-text-property (point) 'byline) t))) (save-excursion (when remove (goto-char bol) @@ -297,9 +298,10 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (goto-char bol) (insert (format "(%s) " (propertize marker 'face 'success))))) + (when at-byline-p ;; leave point after the marker: - (unless remove - (mastodon-tl--goto-next-toot)))) + (unless remove + (mastodon-tl--goto-next-toot))))) (defun mastodon-toot--action (action callback) "Take ACTION on toot at point, then execute CALLBACK. -- cgit v1.2.3