emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ace-window c7cb315 92/92: ace-window.el (aw-copy-window


From: Stefan Monnier
Subject: [elpa] externals/ace-window c7cb315 92/92: ace-window.el (aw-copy-window): Copy window-start and point
Date: Wed, 17 Mar 2021 18:39:29 -0400 (EDT)

branch: externals/ace-window
commit c7cb315c14e36fded5ac4096e158497ae974bec9
Author: ramblehead <v.rybynok@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]