Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix window-start restoring bug

  • Loading branch information...
commit 0ffa7384893f724ed664f15302c1fb915ca5b7e7 1 parent 7c38173
Tomohiro Matsuyama authored
Showing with 22 additions and 1 deletion.
  1. +3 −0  popwin.el
  2. +19 −1 test/popwin-test.el
View
3  popwin.el
@@ -487,6 +487,9 @@ window will not be selected."
(when (popwin:window-deletable-p popwin:popup-window)
(delete-window popwin:popup-window))
(popwin:restore-window-outline (car (window-tree)) popwin:window-outline)
+ ;; Call `redisplay' here so `window-start' could be set
+ ;; prior to the point change of the master buffer.
+ (redisplay)
(when (and (not keep-selected)
(window-live-p popwin:selected-window))
(select-window popwin:selected-window)))
View
20 test/popwin-test.el
@@ -398,13 +398,31 @@
(ert-deftest popwin-restore-window-start ()
(popwin-test:common
- (insert "foo\nbar\n")
+ (insert (make-string 100 ?\n))
(set-window-start nil (point-max))
(popwin:popup-buffer buf2)
+ (set-window-start (get-buffer-window buf1) (point-min))
(popwin:close-popup-window)
(should (eq (current-buffer) buf1))
(should (eq (window-start) (point-max)))))
+(ert-deftest popwin-restore-window-start/*help* ()
+ (require 'help-mode)
+ (describe-function 'popwin:find-file)
+ (switch-to-buffer (help-buffer))
+ (goto-char (point-min))
+ (should (search-forward "popwin.e" (point-max) t))
+ (call-interactively 'push-button)
+ (goto-char (point-max))
+ (describe-function 'popwin:popup-buffer)
+ (switch-to-buffer (help-buffer))
+ (goto-char (point-min))
+ (should (search-forward "popwin.e" (point-max) t))
+ (call-interactively 'push-button)
+ (sit-for 0)
+ (beginning-of-line)
+ (should (search-forward "popwin:popup-buffer" (line-end-position) t)))
+
(ert-deftest popwin-original-display-last-buffer ()
(popwin-test:common
(popwin:popup-buffer buf2)
Please sign in to comment.
Something went wrong with that request. Please try again.