mirror of
https://github.com/chrisbarrett/nursery
synced 2025-08-01 12:17:22 -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)
|
||||
content)
|
||||
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 point start)
|
||||
(insert formatted-preview)
|
||||
|
Reference in New Issue
Block a user