branch: scratch/add-vdiff
commit f11c7c2eeef33a0b75fe4e025818e7e672c57397
Author: Justin Burkett <[email protected]>
Commit: Justin Burkett <[email protected]>
vdiff: Fix vdiff-buffers window layout
When split-width-threshold is too small the window was getting split twice
with
the call to switch-to-buffer-other-window. The new method ensures that the
split
only happens once.
See #15
---
vdiff.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index 6a7fc11..b2c5e91 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -1671,11 +1671,11 @@ function for ON-QUIT to do something useful with the
result."
(buffer-b (get-buffer buffer-b)))
(delete-other-windows)
(switch-to-buffer buffer-a)
- (save-selected-window
- (if horizontal
- (split-window-vertically)
- (split-window-horizontally))
- (switch-to-buffer-other-window buffer-b))
+ (set-window-buffer
+ (if horizontal
+ (split-window-vertically)
+ (split-window-horizontally))
+ buffer-b)
(setq vdiff--temp-session
(vdiff--init-session
buffer-a buffer-b nil