diff --git a/evil-common.el b/evil-common.el index daef2fde..301d97b9 100644 --- a/evil-common.el +++ b/evil-common.el @@ -3000,13 +3000,14 @@ the positions to be outside of this sequence." (when (and (numberp beg) (numberp end)) (setq beg-out (min beg end)) (setq end-out (max beg end)) - (let ((comp (find-composition beg-out))) - ;; find-composition returns (FROM TO VALID-P) - (when (and (listp comp) (nth 2 comp)) - (setq beg-out (nth 0 comp)))) - (let ((comp (find-composition end-out))) - (when (and (listp comp) (nth 2 comp)) - (setq end-out (nth 1 comp)))) + (when evil-treat-composed-chars-as-one + (let ((comp (find-composition beg-out))) + ;; find-composition returns (FROM TO VALID-P) + (when (and (listp comp) (nth 2 comp)) + (setq beg-out (nth 0 comp)))) + (let ((comp (find-composition end-out))) + (when (and (listp comp) (nth 2 comp)) + (setq end-out (nth 1 comp))))) (append (list beg-out end-out) (when (evil-type-p type) (list type)) diff --git a/evil-vars.el b/evil-vars.el index b01ee0aa..3f697966 100644 --- a/evil-vars.el +++ b/evil-vars.el @@ -1104,6 +1104,19 @@ without having to introduce new niche functionality. Prefer to set `evil-v$-excludes-newline' to non-nil." "1.15.0") +(defcustom evil-treat-composed-chars-as-one nil + "EXPERIMENTAL. Treat composed characters as single characters. + +Composed characters are sequences of characters in the buffer +that are displayed as a single glyph. This is the device used by +`prettify-symbols-mode' among others. This option tells evil that +these sequences of characters should be treated as a single unit +to, for example, prevent part of the sequence from being deleted +by an evil command. It alters low-level functionality of evil and +is considered experimental." + :type 'boolean + :group 'evil) + (defcustom evil-v$-excludes-newline nil "If non-nil, `evil-end-of-line' does not move as far as to include the `\n' char at eol. This makes `v$' consistent with `$' used as a