branch: elpa/evil-exchange
commit 548393cb1603b3ab52fd291e9687d2be0d4f022f
Author: Trevor Murphy <[email protected]>
Commit: Trevor Murphy <[email protected]>
Always inhibit operator code when canceling an exchange.
When `evil-exchange` is triggered through the `cx` keybinding, and
then canceled with `c`, this function runs and eventually evil treats
the result as a trivial motion to pass through to the rest of the
operator code.
Since we're canceling the exchange, we never want the rest of the
`evil-exchange` code to run, so we have to explicitly cancel it here.
---
evil-exchange.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/evil-exchange.el b/evil-exchange.el
index 5310f1696b..654ba977d0 100644
--- a/evil-exchange.el
+++ b/evil-exchange.el
@@ -169,6 +169,8 @@
(defun evil-exchange-cancel ()
"Cancel current pending exchange."
(interactive)
+ (when evil-this-operator
+ (setq evil-inhibit-operator t))
(if (null evil-exchange--position)
(message "No pending exchange")
(evil-exchange--clean)