aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-12-01 09:44:32 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-12-01 09:45:20 +0100
commit308a9824fa5391fd4228949faedffd05b46579da (patch)
tree434eaf600f0621ef5e83a9ba8ba20147abf072ae /lisp
parenta0df42d70b8e7285234c4a8bb3d65154c7a31c70 (diff)
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-toot.el6
1 files changed, 5 insertions, 1 deletions
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))))))