Open romandecker opened 4 years ago
in case anybody has similar problems, I was able to work around the issue by not advising evil-delete
and instead defining a new operator and making sure it works with evil-surround
:
(after! evil
(evil-define-operator evil-destroy (beg end type)
"Delete text from BEG to END with TYPE. Just like evil-delete but always
deletes to black-hole"
(evil-delete beg end type ?_ nil))
(map! :n "d" #'evil-destroy)
(map! :n "m" #'evil-delete))
(after! evil-surround
(add-to-list 'evil-surround-operator-alist '(evil-destroy . delete)))
I actually like this solution better than what I originally intended, but the problem that advising evil-delete
breaks evil-surround
still persists.
Wasn't sure if I should file this issue over at the
evil-surround
repo, but I think this is not anevil-surround
problem but rather a problem on how I'm trying to adviseevil-delete
.Issue type
Environment
Emacs version: GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-31 Operating System: macOS Catalina (10.15.5) Evil version: 1.14.0 Evil installation type: manual Graphical/Terminal: both Tested in a
make emacs
session (see CONTRIBUTING.md): YesReproduction steps
make terminal
in evil repoM-x eval-buffer
;; simple advice that should send all deletes to black-hole register (defun evil-delete-advice (orig-fn beg end type register &rest args) (apply orig-fn beg end type ?_ args))
(advice-add 'evil-delete :around #'evil-delete-advice)