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:
9999 """
100100 return cls .exact (amount = 0 )
101101
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-
106102 def __repr__ (self ) -> str :
107103 fields = []
108104 if self .min_specified :
@@ -139,11 +135,11 @@ def max_layout_dimensions(dimensions: list[Dimension]) -> Dimension:
139135 # If all dimensions are size zero. Return zero.
140136 # (This is important for HSplit/VSplit, to report the right values to their
141137 # 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 ()
144140
145141 # 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 ]
147143
148144 if dimensions :
149145 # Take the highest minimum dimension.
You can’t perform that action at this time.
0 commit comments