mirror of
https://github.com/chrisbarrett/nursery
synced 2025-08-05 12:37:24 -05:00
Run preview formatters within save-match-data & save-excursion
Prevents common accidental state updates in preview formatters
This commit is contained in:
@ -341,7 +341,12 @@ When called with a `C-u' prefix arg, clear the current filter."
|
|||||||
(propertize "(Empty)" 'font-lock-face 'font-lock-comment-face)
|
(propertize "(Empty)" 'font-lock-face 'font-lock-comment-face)
|
||||||
content)
|
content)
|
||||||
depth)))))
|
depth)))))
|
||||||
(formatted-preview (seq-reduce (lambda (str fn) (funcall fn str)) post-formatters preview)))
|
(formatted-preview (seq-reduce (lambda (str fn)
|
||||||
|
(save-match-data
|
||||||
|
(save-excursion
|
||||||
|
(funcall fn str))))
|
||||||
|
post-formatters
|
||||||
|
preview)))
|
||||||
(oset section file file)
|
(oset section file file)
|
||||||
(oset section point start)
|
(oset section point start)
|
||||||
(insert formatted-preview)
|
(insert formatted-preview)
|
||||||
|
Reference in New Issue
Block a user