emacs-emojify

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

commit 42d8c8bfa68456d1e7b969ce855b2add22bf53e0
parent 7e88235004a5d3cc7a07ea2e87dc43092e803345
Author: Iqbal Ansari <iqbalansari02@yahoo.com>
Date:   Wed,  7 Sep 2016 23:29:49 +0530

Guard against redisplaying very large regions

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

diff --git a/emojify.el b/emojify.el @@ -1000,10 +1000,12 @@ BEG and END are the beginning and end of the region respectively" Redisplay emojis in the visible region if BEG and END are not specified" (let* ((area (emojify--get-relevant-region)) (beg (or beg (car area))) - (end (or end (cdr area)))) - (emojify-execute-ignoring-errors-unless-debug - (emojify-undisplay-emojis-in-region beg end) - (emojify-display-emojis-in-region beg end)))) + (end (or end (cdr area))) + (region-too-big (> end (+ beg (* 10 (- (window-end) (window-start))))))) + (unless region-too-big + (emojify-execute-ignoring-errors-unless-debug + (emojify-undisplay-emojis-in-region beg end) + (emojify-display-emojis-in-region beg end))))) (defun emojify-after-change-extend-region-function (beg end _len) "Extend the region to be emojified.