From 1194d6162ad582174a4852f4e14b86d4053db70d Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Wed, 30 Jan 2019 11:28:59 -0800 Subject: [PATCH] Add copy-window functionality Fixes #156 Fixes #149 --- ace-window.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ace-window.el b/ace-window.el index 1a24c7b..18333fb 100644 --- a/ace-window.el +++ b/ace-window.el @@ -158,10 +158,11 @@ Consider changing this if the overlay tends to overlap with other things." '((?x aw-delete-window "Delete Window") (?m aw-swap-window "Swap Windows") (?M aw-move-window "Move Window") + (?c aw-copy-window "Copy Window") (?j aw-switch-buffer-in-window "Select Buffer") (?n aw-flip-window) (?u aw-switch-buffer-other-window "Switch Buffer Other Window") - (?c aw-split-window-fair "Split Fair Window") + (?f aw-split-window-fair "Split Fair Window") (?v aw-split-window-vert "Split Vert Window") (?b aw-split-window-horz "Split Horz Window") (?o delete-other-windows "Delete Other Windows") @@ -724,6 +725,12 @@ Switch the current window to the previous buffer." (aw-switch-to-window window) (switch-to-buffer buffer))) +(defun aw-copy-window (window) + "Copy the current buffer to WINDOW." + (let ((buffer (current-buffer))) + (aw-switch-to-window window) + (switch-to-buffer buffer))) + (defun aw-split-window-vert (window) "Split WINDOW vertically." (select-window window)