File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
src/prompt_toolkit/layout Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,6 @@ def zero(cls) -> Dimension:
99
99
"""
100
100
return cls .exact (amount = 0 )
101
101
102
- def is_zero (self ) -> bool :
103
- "True if this `Dimension` represents a zero size."
104
- return self .preferred == 0 or self .max == 0
105
-
106
102
def __repr__ (self ) -> str :
107
103
fields = []
108
104
if self .min_specified :
@@ -139,11 +135,11 @@ def max_layout_dimensions(dimensions: list[Dimension]) -> Dimension:
139
135
# If all dimensions are size zero. Return zero.
140
136
# (This is important for HSplit/VSplit, to report the right values to their
141
137
# parent when all children are invisible.)
142
- if all (d .is_zero () for d in dimensions ):
143
- return dimensions [ 0 ]
138
+ if all (d .preferred == 0 and d . max == 0 for d in dimensions ):
139
+ return Dimension . zero ()
144
140
145
141
# Ignore empty dimensions. (They should not reduce the size of others.)
146
- dimensions = [d for d in dimensions if not d . is_zero () ]
142
+ dimensions = [d for d in dimensions if d . preferred != 0 and d . max != 0 ]
147
143
148
144
if dimensions :
149
145
# Take the highest minimum dimension.
You can’t perform that action at this time.
0 commit comments