scrolling errors.

This commit is contained in:
Kazu Yamamoto 2015-08-13 17:39:01 +09:00
parent 002008aa30
commit efef2b19ea

View File

@ -110,9 +110,15 @@
(goto-char (point-max))
(insert-buffer-substring tbuf 1 end))
(with-current-buffer (get-buffer-create ghc-error-buffer)
(goto-char (point-max))
(insert-buffer-substring tbuf 1 end)
(display-buffer (current-buffer))
(let* ((cbuf (current-buffer))
cwin)
(unless (get-buffer-window cbuf) (display-buffer cbuf))
(setq cwin (get-buffer-window cbuf))
(goto-char (point-max))
(insert-buffer-substring tbuf 1 end)
(unless (pos-visible-in-window-p (point) cwin)
(with-selected-window cwin
(scroll-up 2))))
(redisplay)))
(delete-region 1 end)))))
(goto-char (point-max))