Make evil backspace/DEL respect delete-selection-mode

Perhaps this should be fixed upstream?
This commit is contained in:
Henrik Lissner 2020-01-05 19:14:54 -05:00
parent cd3f1399af
commit 40a35392d1
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -161,6 +161,13 @@ directives. By default, this only recognizes C directives.")
(advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a) (advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a)
(advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a) (advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a)
;; Fix backspace/DEL commands not respecting `delete-selection-mode'
(defadvice! +evil-delete-region-if-mark-a (orig-fn &rest args)
:around '(evil-delete-backward-word evil-delete-backward-char-and-join)
(if (and (bound-and-true-p delete-selection-mode) mark-active)
(call-interactively #'backward-delete-char-untabify)
(apply orig-fn args)))
;; Recenter screen after most searches ;; Recenter screen after most searches
(dolist (fn '(evil-visualstar/begin-search-forward (dolist (fn '(evil-visualstar/begin-search-forward
evil-visualstar/begin-search-backward evil-visualstar/begin-search-backward