Wrap plantuml-indent-line with save-excursion

This commit is contained in:
Raymond Huang 2018-08-13 06:23:11 -07:00
parent 9b1c1bfc27
commit 63454ddcc3
1 changed files with 8 additions and 7 deletions

View File

@ -397,13 +397,14 @@ Uses prefix (as PREFIX) to choose where to display it:
(defun plantuml-indent-line ()
(interactive)
(beginning-of-line)
(if (bobp)
(indent-line-to 0)
(let ((offset (plantuml-current-block-indentation)))
(when (looking-at plantuml-indent-regexp-end)
(setq offset (max (- offset 2) 0)))
(indent-line-to offset))))
(save-excursion
(beginning-of-line)
(if (bobp)
(indent-line-to 0)
(let ((offset (plantuml-current-block-indentation)))
(when (looking-at plantuml-indent-regexp-end)
(setq offset (max (- offset 2) 0)))
(indent-line-to offset)))))
;;;###autoload