Skip to content

Commit 465f038

Browse files
senhalilpaulusmack
authored andcommitted
gitk: include y coord in recorded sash position
6cd8049 ("gitk: Resize panes correctly when reducing window size", 2020-10-03) introduces a mechanism to record previously-set sash positions to make sure that correct values are used while computing resize proportions. However, if we are not using ttk, then sash represents only the x coordinate and the recorded sash (`oldsash`) only includes the x coordinate. When we need to access the y coordinate via the recorded sash position, we generate the following Application Error popup: Error: expected integer but got "" expected integer but got "" expected integer but got "" while executing "$win sash place 0 $sash0 [lindex $s0 1]" (procedure "resizeclistpanes" line 38) invoked from within "resizeclistpanes .tf.histframe.pwclist 2818" (command bound to event) To fix this, if we are not using ttk, we append the sash positions with the y coordinates before recording them to match the use_ttk case. Signed-off-by: Halil Sen <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 1f6b196 commit 465f038

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gitk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,6 +2991,8 @@ proc resizeclistpanes {win w} {
29912991
} else {
29922992
$win sash place 0 $sash0 [lindex $s0 1]
29932993
$win sash place 1 $sash1 [lindex $s1 1]
2994+
set sash0 [list $sash0 [lindex $s0 1]]
2995+
set sash1 [list $sash1 [lindex $s1 1]]
29942996
}
29952997
set oldsash($win) [list $sash0 $sash1]
29962998
}
@@ -3023,6 +3025,7 @@ proc resizecdetpanes {win w} {
30233025
$win sashpos 0 $sash0
30243026
} else {
30253027
$win sash place 0 $sash0 [lindex $s0 1]
3028+
set sash0 [list $sash0 [lindex $s0 1]]
30263029
}
30273030
set oldsash($win) $sash0
30283031
}

0 commit comments

Comments
 (0)