Skip to content

Commit

Permalink
racket--get-text-property/bounds: Add bounds check; fixes greghenders…
Browse files Browse the repository at this point in the history
  • Loading branch information
greghendershott committed Dec 6, 2024
1 parent 22dc95c commit 68c03cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion racket-xp.el
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@ racket-xp-doc and help-echo text properties added by
(defun racket--get-text-property/bounds (pos prop)
"Like `get-text-property' but also returning the bounds."
(when-let (val (get-text-property pos prop))
(let* ((beg (if (not (get-text-property (1- pos) prop))
(let* ((beg (if (or (= 1 pos)
(not (get-text-property (1- pos) prop)))
pos
(previous-single-property-change pos prop)))
(end (or (next-single-property-change beg prop)
Expand Down

0 comments on commit 68c03cd

Please sign in to comment.