vterm: when deleting command with `dd`, reset cursor after prompt

The original `evil-first-non-blank` isn't usable because the beginning
of the prompt is the first non-blank character. Strangely enough,
`vterm-beginning-of-line` didn't work either.
This commit is contained in:
Jakub Kadlcik 2022-05-06 16:18:38 -04:00
parent 9707efcae4
commit b2dca869db
1 changed files with 3 additions and 1 deletions

View File

@ -109,6 +109,8 @@ after the prompt."
(vterm-goto-char (+ 1 (point)))
(call-interactively #'vterm-yank arg))
(declare-function vterm-reset-cursor-point "vterm")
(evil-define-operator evil-collection-vterm-delete (beg end type register yank-handler)
"Modification of evil-delete to work in vterm buffer.
Delete text from BEG to END with TYPE.
@ -138,7 +140,7 @@ Save in REGISTER or in the kill-ring with YANK-HANDLER."
;; place cursor on beginning of line
(when (and (called-interactively-p 'any)
(eq type 'line))
(evil-first-non-blank))))
(vterm-reset-cursor-point))))
(evil-define-operator evil-collection-vterm-delete-backward-char (beg end type register)
"Delete previous character."