branch: elpa/golden-ratio
commit 7da7dd7d53ae9b524a461f6962b81347a8f3dc2b
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    * golden-ratio.el (golden-ratio-recenter): New user var, allow recentering
    and scrolling right as before when non--nil.
---
 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

Reply via email to