emacs-emojify

fork of https://github.com/iqbalansari/emacs-emojify
Log | Files | Refs | LICENSE

commit 870878c02d472a7a838bf263c8851fa3e5e52097
parent f84cd45ce4f846eea9dcbb4766c210a3b19dca93
Author: Iqbal Ansari <iqbalansari02@yahoo.com>
Date:   Sun,  6 Dec 2015 10:52:40 +0530

Do not blindly set jit-lock-start and jit-lock-end in `emojify-after-change-extend-region-function`

Set them only if the existing values not contain the region we want to
redisplayed

Diffstat:
Memojify.el | 18++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/emojify.el b/emojify.el @@ -830,12 +830,18 @@ end of line at END. _LEN is ignored. The idea is since an emoji cannot span multiple lines, redisplaying complete lines ensures that all the possibly affected emojis are redisplayed." - (setq jit-lock-start (save-excursion - (goto-char beg) - (line-beginning-position)) - jit-lock-end (save-excursion - (goto-char end) - (line-end-position)))) + (let ((emojify-jit-lock-start (save-excursion + (goto-char beg) + (line-beginning-position))) + (emojify-jit-lock-end (save-excursion + (goto-char end) + (line-end-position)))) + (setq jit-lock-start (if jit-lock-start + (min jit-lock-start emojify-jit-lock-start) + emojify-jit-lock-start)) + (setq jit-lock-end (if jit-lock-end + (max jit-lock-end emojify-jit-lock-end) + emojify-jit-lock-end))))