Skip to content

Commit

Permalink
Use evil-first-non-blank instead of back-to-indentation for insert
Browse files Browse the repository at this point in the history
Improves consistency
  • Loading branch information
tomdl89 committed Jun 17, 2024
1 parent 7bfdb13 commit 18962ce
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions evil-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -2803,7 +2803,7 @@ or the beginning of visual line. The insertion will be repeated COUNT times.
If VCOUNT is non nil it should be number > 0. The insertion will be repeated
in the next VCOUNT - 1 lines below the current one."
(push (point) buffer-undo-list)
(let ((move-fn (if non-blank-p #'back-to-indentation #'evil-beginning-of-line)))
(let ((move-fn (if non-blank-p #'evil-first-non-blank #'evil-beginning-of-line)))
(if (and visual-line-mode
evil-respect-visual-line-mode)
(goto-char
Expand All @@ -2813,15 +2813,15 @@ in the next VCOUNT - 1 lines below the current one."
(save-excursion
(beginning-of-visual-line)
(point))))
(funcall move-fn)))
(setq evil-insert-count count
evil-insert-lines nil
evil-insert-vcount
(and vcount
(> vcount 1)
(list (line-number-at-pos)
(if non-blank-p #'evil-first-non-blank #'evil-beginning-of-line)
vcount)))
(funcall move-fn))
(setq evil-insert-count count
evil-insert-lines nil
evil-insert-vcount
(and vcount
(> vcount 1)
(list (line-number-at-pos)
move-fn
vcount))))
(evil-insert-state 1))

(defun evil-insert-line (count &optional vcount)
Expand Down

0 comments on commit 18962ce

Please sign in to comment.