branch: master commit 36590b044f86a546b1a0b21e89e301ed29408be4 Author: Paul Nelson <ultr...@gmail.com> Commit: Ikumi Keita <ik...@ikumi.que.jp>
Fix preview bug involving long common suffixes * preview.el.in (preview-parse-messages): Fix it. --- preview.el.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/preview.el.in b/preview.el.in index a2c0235d..12500011 100644 --- a/preview.el.in +++ b/preview.el.in @@ -3340,6 +3340,7 @@ call, and in its CDR the final stuff for the placement hook." (let (TeX-error-file TeX-error-offset snippet box counters file line (lsnippet 0) lstart (lfile "") lline lbuffer lpoint + lpos lcounters string after-string offset @@ -3610,6 +3611,12 @@ name(\\([^)]+\\))\\)\\|\ (car preview-current-region)) (goto-char (car preview-current-region))) + ;; Make sure that we don't accidentally match + ;; something earlier in the search that follows. + (and (eq (current-buffer) lbuffer) + (= lline line) + (goto-char (max (point) (- (1+ lpos) (length string))))) + (cond ((search-forward (concat string after-string) (line-end-position) t) @@ -3645,6 +3652,7 @@ name(\\([^)]+\\))\\)\\|\ string (line-end-position) t)))) (setq lline line + lpos (point) lbuffer (current-buffer)) (if box (progn