Fix off-by-one cursor issue with indent-new-comment-line
This commit is contained in:
parent
0c885e450b
commit
37ea71eff6
1 changed files with 7 additions and 1 deletions
|
@ -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))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue