diff --git a/evil-common.el b/evil-common.el index 9d0d55b5..daef2fde 100644 --- a/evil-common.el +++ b/evil-common.el @@ -2995,15 +2995,19 @@ type as per `evil-type-p', and PROPERTIES is a property list. If beg or end are inside a sequence of composed characters, adjust the positions to be outside of this sequence." (let ((beg (evil-normalize-position beg)) - (end (evil-normalize-position end))) - (let ((comp (find-composition beg))) - (when (and (listp comp) (nth 2 comp)) ; valid composition - (setq beg (nth 0 comp)))) - (let ((comp (find-composition end))) - (when (and (listp comp) (nth 2 comp)) - (setq end (nth 1 comp)))) + (end (evil-normalize-position end)) + beg-out end-out) (when (and (numberp beg) (numberp end)) - (append (list (min beg end) (max beg 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)))) + (append (list beg-out end-out) (when (evil-type-p type) (list type)) properties))))