branch: elpa/golden-ratio
commit 79ead1cba6266d56c09213e4d84f3901d8250fb7
Merge: 33aa083b66 7da7dd7d53
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Merge pull request #35 from thierryvolpiatto/master
* golden-ratio.el (golden-ratio-recenter): New user var, allow recenteri...
---
golden-ratio.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/golden-ratio.el b/golden-ratio.el
index c28b3d4f28..d6e8c6a49a 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -56,7 +56,12 @@ will not cause the window to be resized to the golden ratio."
"List of extra commands used to jump to other window."
:group 'golden-ratio
:type '(repeat symbol))
-
+
+(defcustom golden-ratio-recenter nil
+ "Recenter window vertically and scroll right when non--nil."
+ :group 'golden-ratio
+ :type 'boolean)
+
;;; Compatibility
;;
(unless (fboundp 'window-resizable-p)
@@ -95,6 +100,8 @@ will not cause the window to be resized to the golden ratio."
(golden-ratio-mode -1)
(balance-windows)
(golden-ratio--resize-window dims)
+ (when golden-ratio-recenter
+ (scroll-right) (recenter))
(golden-ratio-mode golden-p))))
;; Should return nil