Skip to content

Commit 42f77b3

Browse files
authored
Merge pull request #233 from woutgg/master
Fix #176.
2 parents 7c77c70 + 2f5394b commit 42f77b3

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

scripts/save.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,6 @@ dump_windows() {
244244
if is_session_grouped "$session_name"; then
245245
continue
246246
fi
247-
# window_layout is not correct for zoomed windows
248-
if [[ "$window_flags" == *Z* ]]; then
249-
# unmaximize the window
250-
toggle_window_zoom "${session_name}:${window_index}"
251-
# get correct window layout
252-
window_layout="$(tmux display-message -p -t "${session_name}:${window_index}" -F "#{window_layout}")"
253-
# sleep required otherwise vim does not redraw correctly, issue #112
254-
sleep 0.1 || sleep 1 # portability hack
255-
# maximize window again
256-
toggle_window_zoom "${session_name}:${window_index}"
257-
fi
258247
echo "${line_type}${d}${session_name}${d}${window_index}${d}${window_active}${d}${window_flags}${d}${window_layout}"
259248
done
260249
}

tests/fixtures/restore_file.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ pane blue 1 :man 0 :- 0 :/tmp 0 bash :
44
pane blue 1 :man 0 :- 1 :/usr/share/man 1 man :man echo
55
pane blue 2 :bash 1 :* 0 :/tmp 1 bash :
66
pane red 0 :bash 0 : 0 :/tmp 1 bash :
7-
pane red 1 :bash 0 :- 0 :/tmp 0 bash :
8-
pane red 1 :bash 0 :- 1 :/tmp 0 bash :
9-
pane red 1 :bash 0 :- 2 :/tmp 1 bash :
7+
pane red 1 :bash 0 :-Z 0 :/tmp 0 bash :
8+
pane red 1 :bash 0 :-Z 1 :/tmp 0 bash :
9+
pane red 1 :bash 0 :-Z 2 :/tmp 1 bash :
1010
pane red 2 :bash 1 :* 0 :/tmp 0 bash :
1111
pane red 2 :bash 1 :* 1 :/tmp 1 bash :
1212
pane yellow 0 :bash 1 :* 0 :/tmp/bar 1 bash :
@@ -15,7 +15,7 @@ window blue 0 0 : ce9f,200x49,0,0,2
1515
window blue 1 0 :- 178b,200x49,0,0{100x49,0,0,3,99x49,101,0,4}
1616
window blue 2 1 :* cea2,200x49,0,0,5
1717
window red 0 0 : cea3,200x49,0,0,6
18-
window red 1 0 :- 135b,200x49,0,0[200x24,0,0,7,200x24,0,25{100x24,0,25,8,99x24,101,25,9}]
18+
window red 1 0 :-Z 135b,200x49,0,0[200x24,0,0,7,200x24,0,25{100x24,0,25,8,99x24,101,25,9}]
1919
window red 2 1 :* db81,200x49,0,0[200x24,0,0,10,200x24,0,25,11]
2020
window yellow 0 1 :* 6781,200x49,0,0,12
2121
state yellow blue

tests/fixtures/save_file.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ pane blue 1 :man 0 :!- 0 :/tmp 0 bash :
44
pane blue 1 :man 0 :!- 1 :/usr/share/man 1 man :man echo
55
pane blue 2 :bash 1 :* 0 :/tmp 1 bash :
66
pane red 0 :bash 0 : 0 :/tmp 1 bash :
7-
pane red 1 :bash 0 :- 0 :/tmp 0 bash :
8-
pane red 1 :bash 0 :- 1 :/tmp 0 bash :
9-
pane red 1 :bash 0 :- 2 :/tmp 1 bash :
7+
pane red 1 :bash 0 :-Z 0 :/tmp 0 bash :
8+
pane red 1 :bash 0 :-Z 1 :/tmp 0 bash :
9+
pane red 1 :bash 0 :-Z 2 :/tmp 1 bash :
1010
pane red 2 :bash 1 :* 0 :/tmp 0 bash :
1111
pane red 2 :bash 1 :* 1 :/tmp 1 bash :
1212
pane yellow 0 :bash 1 :* 0 :/tmp/bar 1 bash :
@@ -15,7 +15,7 @@ window blue 0 0 :! cea4,200x49,0,0,7
1515
window blue 1 0 :!- 9797,200x49,0,0{100x49,0,0,8,99x49,101,0,9}
1616
window blue 2 1 :* 677f,200x49,0,0,10
1717
window red 0 0 : ce9e,200x49,0,0,1
18-
window red 1 0 :- 52b7,200x49,0,0[200x24,0,0,2,200x24,0,25{100x24,0,25,3,99x24,101,25,4}]
18+
window red 1 0 :-Z 52b7,200x49,0,0[200x24,0,0,2,200x24,0,25{100x24,0,25,3,99x24,101,25,4}]
1919
window red 2 1 :* bd68,200x49,0,0[200x24,0,0,5,200x24,0,25,6]
2020
window yellow 0 1 :* 6780,200x49,0,0,11
2121
state yellow blue

tests/helpers/create_and_save_tmux_test_environment.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ new_tmux_session "red"
1616
new_tmux_window
1717
horizontal_split
1818
vertical_split
19+
toggle_zoom_pane
1920

2021
new_tmux_window
2122
horizontal_split

tests/helpers/expect_helpers.exp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ proc vertical_split {} {
4444
sleep 0.1
4545
}
4646

47+
proc toggle_zoom_pane {} {
48+
send "z"
49+
sleep 0.2
50+
}
51+
4752
proc run_shell_command {command} {
4853
send "$command\r"
4954
sleep 1

0 commit comments

Comments
 (0)