commit b44b8aca65bc0fd4903585dbb3c06a9187039881
parent 64f8815888befea1797d6ba08b8bde3d529b12f7
Author: Iqbal Ansari <iqbal.ansari@ignitesol.com>
Date: Thu, 29 Oct 2015 15:01:56 +0530
Ensure we have not moved past the region end while searching for regexp
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/emojify.el b/emojify.el
@@ -199,7 +199,8 @@ Used by `emojify-display-emojis-in-region' and `emojify-undisplay-emojis-in-regi
BEG and END are the beginning and end of the region respectively"
(emojify-with-saved-buffer-state
(goto-char beg)
- (while (search-forward-regexp emoji-regexps end t)
+ (while (and (> end (point))
+ (search-forward-regexp emoji-regexps end t))
(let ((match-beginning (match-beginning 0))
(match-end (match-end 0))
(match (match-string-no-properties 0))