From bbcda6be9a90b901ec188bf4227f4f09e64498e6 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 19 Apr 2007 17:21:37 +0000 Subject: [PATCH] (show-paren-function): Reset window-start to avoid recentering. --- lisp/paren.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/paren.el b/lisp/paren.el index 95f718d5683..17f0c401901 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -143,6 +143,7 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time." (let ((oldpos (point)) (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1) ((eq (syntax-class (syntax-after (point))) 4) 1))) + (window-start (window-start)) pos mismatch face) ;; ;; Find the other end of the sexp. @@ -247,7 +248,12 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time." ;; ;; Always set the overlay face, since it varies. (overlay-put show-paren-overlay 'priority show-paren-priority) - (overlay-put show-paren-overlay 'face face))) + (overlay-put show-paren-overlay 'face face)) + ;; If there are continued lines, the above operations can + ;; force redisplay to recenter the window (since there is no + ;; way for it to know that the overlay changes to the buffer + ;; are harmless). So reset the window-start. + (set-window-start (selected-window) window-start)) ;; show-paren-mode is nil in this buffer. (and show-paren-overlay (delete-overlay show-paren-overlay)) -- 2.39.2