From c7cb315c14e36fded5ac4096e158497ae974bec9 Mon Sep 17 00:00:00 2001 From: ramblehead Date: Sat, 6 Jun 2020 12:40:46 +0100 Subject: [PATCH] ace-window.el (aw-copy-window): Copy window-start and point Fixes #193 Fixes #194 --- ace-window.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ace-window.el b/ace-window.el index 416aa7d..3c99ccd 100644 --- a/ace-window.el +++ b/ace-window.el @@ -816,10 +816,14 @@ Switch the current window to the previous buffer." (switch-to-buffer buffer))) (defun aw-copy-window (window) - "Copy the current buffer to WINDOW." - (let ((buffer (current-buffer))) + "Copy the current buffer to WINDOW - including window-start and point." + (let ((buffer (current-buffer)) + (window-start (window-start)) + (point (point))) (aw-switch-to-window window) - (switch-to-buffer buffer))) + (switch-to-buffer buffer) + (set-window-start (frame-selected-window) window-start) + (goto-char point))) (defun aw-split-window-vert (window) "Split WINDOW vertically."