Restore window zoom state

Close #25
pull/26/head
Bruno Sutic 2014-08-29 17:04:00 +02:00
parent 05cf790493
commit cedd1292c1
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
3 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,7 @@
- if pane exists from before session restore - do not restore the process within
it. This makes the restoration process even more idempotent.
- more panes within a window can now be restored
- restore window zoom state
### v0.2.0, 2014-08-29
- bugfix: with vim 'session' strategy, if the session file does not exist - make

View File

@ -28,6 +28,7 @@ This plugin goes to great lengths to save and restore all the details from your
- **exact pane layouts** within windows
- active and alternative session
- active and alternative window for each session
- windows with focus
- active pane for each window
- programs running within a pane! More details in the
[configuration section](#configuration).

View File

@ -160,13 +160,20 @@ restore_pane_layout_for_each_window() {
}
restore_active_pane_for_each_window() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $7 != 0 && $9 == 1 { print $2, $3, $7; }' $(last_session_path) |
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $9 == 1 { print $2, $3, $7; }' $(last_session_path) |
while IFS=$'\t' read session_name window_number active_pane; do
tmux switch-client -t "${session_name}:${window_number}"
tmux select-pane -t "$active_pane"
done
}
restore_zoomed_windows() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $5 ~ /Z/ { print $2, $3; }' $(last_session_path) |
while IFS=$'\t' read session_name window_number; do
tmux resize-pane -t "${session_name}:${window_number}" -Z
done
}
restore_active_and_alternate_windows() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $5 ~ /[*-]/ { print $2, $4, $3; }' $(last_session_path) |
sort -u |
@ -191,6 +198,7 @@ main() {
restore_all_pane_processes
# below functions restore exact cursor positions
restore_active_pane_for_each_window
restore_zoomed_windows
restore_active_and_alternate_windows
restore_active_and_alternate_sessions
stop_spinner