mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-13 13:13:35 -05:00
Fix off-by-one cursor issue with indent-new-comment-line
This commit is contained in:
@@ -147,7 +147,13 @@ spaces on either side of the point if so. Resorts to
|
|||||||
(newline-and-indent)
|
(newline-and-indent)
|
||||||
(insert "* ")
|
(insert "* ")
|
||||||
(indent-according-to-mode))
|
(indent-according-to-mode))
|
||||||
(t (indent-new-comment-line))))
|
(t
|
||||||
|
;; Fix an off-by-one cursor-positioning issue
|
||||||
|
;; with `indent-new-comment-line'
|
||||||
|
(let ((col (save-excursion (comment-beginning) (current-column))))
|
||||||
|
(indent-new-comment-line)
|
||||||
|
(unless (= col (current-column))
|
||||||
|
(insert " "))))))
|
||||||
(t
|
(t
|
||||||
(newline nil t)
|
(newline nil t)
|
||||||
(indent-according-to-mode))))
|
(indent-according-to-mode))))
|
||||||
|
Reference in New Issue
Block a user