Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inflloop in font-lock due to mismatched cache #110

Merged
merged 1 commit into from
Mar 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2891,13 +2891,17 @@ Return nil otherwise."
(defun markdown-match-propertized-text (property last)
"Match text with PROPERTY from point to LAST.
Restore match data previously stored in PROPERTY."
(let (saved pos)
(unless (setq saved (get-text-property (point) property))
(let ((saved (get-text-property (point) property))
pos)
(unless saved
(setq pos (next-single-char-property-change (point) property nil last))
(setq saved (get-text-property pos property)))
(when saved
(set-match-data saved)
(goto-char (min (1+ (match-end 0)) (point-max)))
;; Step at least one character beyond point. Otherwise
;; `font-lock-fontify-keywords-region' infloops.
(goto-char (min (1+ (max (match-end 0) (point)))
(point-max)))
saved)))

(defun markdown-match-pre-blocks (last)
Expand Down