I don’t know why the motion didn’t work in Evil mode, but if the goal is deleting all invisible Unicode characters, I’d write a command like this:
(defun my/delete-invisibles-in-region (start end)
"Delete invisible characters in the region specified with START and END."
(interactive "r")
(save-excursion
(replace-regexp "\u200B\\|\u200C" "" nil start end))
;; (query-replace-regexp "\u200B\\|\u200C" "" nil start end))
(deactivate-mark))
Can you get the stack trace with
(setq debug-on-error t)
? The error meansrx
got wrong regex form like(rx (** 3 2 "a"))
or(rx (** 3 nil "a"))
.