From 308a9824fa5391fd4228949faedffd05b46579da Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 1 Dec 2022 09:44:32 +0100 Subject: completion - bound the --get-bounds backward regex search this prevents matching when we have type words after a handle/tag (forward-whitespace -1) places point before the previous space. placing it after doesn't work, it breaks some completion cases. --- lisp/mastodon-toot.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 7efe682..9402241 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -869,7 +869,11 @@ eg. \"feduser@fed.social\" -> \"feduser@fed.social\"." (save-excursion ;; match full handle inc. domain, or tag including # ;; (see the regexes for subexp 2) - (when (re-search-backward regex nil :no-error) + (when (re-search-backward regex + (save-excursion + (forward-whitespace -1) + (point)) + :no-error) (cons (match-beginning 2) (match-end 2)))))) -- cgit v1.2.3