Skip to content

Commit c7cb315

Browse files
rambleheadabo-abo
authored andcommitted
ace-window.el (aw-copy-window): Copy window-start and point
Fixes abo-abo#193 Fixes abo-abo#194
1 parent 7003c88 commit c7cb315

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ace-window.el

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,14 @@ Switch the current window to the previous buffer."
816816
(switch-to-buffer buffer)))
817817

818818
(defun aw-copy-window (window)
819-
"Copy the current buffer to WINDOW."
820-
(let ((buffer (current-buffer)))
819+
"Copy the current buffer to WINDOW - including window-start and point."
820+
(let ((buffer (current-buffer))
821+
(window-start (window-start))
822+
(point (point)))
821823
(aw-switch-to-window window)
822-
(switch-to-buffer buffer)))
824+
(switch-to-buffer buffer)
825+
(set-window-start (frame-selected-window) window-start)
826+
(goto-char point)))
823827

824828
(defun aw-split-window-vert (window)
825829
"Split WINDOW vertically."

0 commit comments

Comments
 (0)