Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sr-lock-window a bit more resilient

If I type C-x 1 in the viewer window, make Sunrise Commander think that
it was exited.
  • Loading branch information...
commit c06c4512a4d6827ef01b4f9070685d703dd64249 1 parent 3a9a577
@jwiegley jwiegley authored committed
Showing with 20 additions and 18 deletions.
  1. +20 −18 sunrise-commander.el
View
38 sunrise-commander.el
@@ -1327,24 +1327,26 @@ buffer or window."
(defun sr-lock-window (frame)
"Resize the left Sunrise pane to have the \"right\" size."
(when sr-running
- (let ((sr-windows-locked sr-windows-locked))
- (when (> window-min-height (- (frame-height)
- (window-height sr-left-window)))
- (setq sr-windows-locked nil))
- (and sr-windows-locked
- (not sr-ediff-on)
- (not (eq sr-window-split-style 'vertical))
- (window-live-p sr-left-window)
- (save-selected-window
- (select-window sr-left-window)
- (let* ((my-style-factor
- (if (eq sr-window-split-style 'horizontal) 2 1))
- (my-delta (- sr-panes-height (window-height))))
- (enlarge-window my-delta))
- (scroll-right)
- (when (window-live-p sr-right-window)
- (select-window sr-right-window)
- (scroll-right)))))))
+ (if (not (window-live-p sr-left-window))
+ (setq sr-running nil)
+ (let ((sr-windows-locked sr-windows-locked))
+ (when (> window-min-height (- (frame-height)
+ (window-height sr-left-window)))
+ (setq sr-windows-locked nil))
+ (and sr-windows-locked
+ (not sr-ediff-on)
+ (not (eq sr-window-split-style 'vertical))
+ (window-live-p sr-left-window)
+ (save-selected-window
+ (select-window sr-left-window)
+ (let* ((my-style-factor
+ (if (eq sr-window-split-style 'horizontal) 2 1))
+ (my-delta (- sr-panes-height (window-height))))
+ (enlarge-window my-delta))
+ (scroll-right)
+ (when (window-live-p sr-right-window)
+ (select-window sr-right-window)
+ (scroll-right))))))))
;; This keeps the size of the Sunrise panes constant:
(add-hook 'window-size-change-functions 'sr-lock-window)
Please sign in to comment.
Something went wrong with that request. Please try again.