Ignore errors when attempting to delete region in org-format

This commit is contained in:
Chris Barrett
2022-09-18 16:19:02 +12:00
parent c15b175f5e
commit 0e3fca4634

View File

@ -67,8 +67,9 @@ Only applies to level-1 headings in the document."
(forward-char -1)
(let ((start (point)))
(when (search-backward-regexp (rx (not (any space "\n"))))
(forward-char 1)
(delete-region (point) start)))
(ignore-errors
(forward-char 1)
(delete-region (point) start))))
(insert (make-string n ?\n)))))
(defun org-format--in-archived-heading-p ()