From 360a7bb370e81fa372dd4fde88b9deb3915f8fd0 Mon Sep 17 00:00:00 2001 From: Syohei YOSHIDA Date: Fri, 27 May 2016 17:10:22 +0900 Subject: [PATCH] Don't return point which is larger than point-max Original code sometimes returns point larger than point-max, then syntax-propertize function raises args-out-of-range signal. --- markdown-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown-mode.el b/markdown-mode.el index 8bd11a0b..0fdd9994 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -1520,7 +1520,7 @@ Function is called repeatedly until it returns nil. For details, see (code-match (markdown-code-block-at-pos end)) (new-end (or (and code-match (cl-second code-match)) new-end))) (unless (and (eq new-start start) (eq new-end end)) - (cons new-start new-end)))))) + (cons new-start (min new-end (point-max)))))))) (defun markdown-font-lock-extend-region-function (start end _) "Used in `jit-lock-after-change-extend-region-functions'.