Skip to content

Commit 4d862c7

Browse files
committed
version bump and fix
1 parent 1a7f9ff commit 4d862c7

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [0.56.2] - 2024-04-07
9+
10+
### Fixed
11+
12+
- Fixed inline mode not clearing with multiple screen
13+
814
## [0.56.1] - 2024-04-07
915

1016
### Fixed
@@ -1853,6 +1859,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
18531859
- New handler system for messages that doesn't require inheritance
18541860
- Improved traceback handling
18551861

1862+
[0.56.2]: https://github.com/Textualize/textual/compare/v0.56.1...v0.56.2
18561863
[0.56.1]: https://github.com/Textualize/textual/compare/v0.56.0...v0.56.1
18571864
[0.56.0]: https://github.com/Textualize/textual/compare/v0.55.1...v0.56.0
18581865
[0.55.1]: https://github.com/Textualize/textual/compare/v0.55.0...v0.55.1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "0.56.1"
3+
version = "0.56.2"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/_compositor.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ def render_segments(self, console: Console) -> str:
184184
else:
185185
append("\r")
186186
append("\x1b[6n") # Query new cursor position
187-
188187
return "".join(sequences)
189188

190189

@@ -338,9 +337,6 @@ def __init__(self) -> None:
338337
# Mapping of line numbers on to lists of widget and regions
339338
self._layers_visible: list[list[tuple[Widget, Region, Region]]] | None = None
340339

341-
# Size of previous inline update
342-
self._previous_inline_height: int | None = None
343-
344340
@classmethod
345341
def _regions_to_spans(
346342
cls, regions: Iterable[Region]
@@ -1023,7 +1019,10 @@ def render_update(
10231019
return self.render_partial_update()
10241020

10251021
def render_inline(
1026-
self, size: Size, screen_stack: list[Screen] | None = None
1022+
self,
1023+
size: Size,
1024+
screen_stack: list[Screen] | None = None,
1025+
clear: bool = False,
10271026
) -> RenderableType:
10281027
"""Render an inline update.
10291028
@@ -1036,11 +1035,6 @@ def render_inline(
10361035
"""
10371036
visible_screen_stack.set([] if screen_stack is None else screen_stack)
10381037
strips = self.render_strips(size)
1039-
clear = (
1040-
self._previous_inline_height is not None
1041-
and len(strips) < self._previous_inline_height
1042-
)
1043-
self._previous_inline_height = len(strips)
10441038
return InlineUpdate(strips, clear=clear)
10451039

10461040
def render_full_update(self) -> LayoutUpdate:

src/textual/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,9 @@ def __init__(
637637
happens.
638638
"""
639639

640+
# Size of previous inline update
641+
self._previous_inline_height: int | None = None
642+
640643
def validate_title(self, title: Any) -> str:
641644
"""Make sure the title is set to a string."""
642645
return str(title)

src/textual/screen.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,13 +676,20 @@ def _compositor_refresh(self) -> None:
676676

677677
if self is app.screen:
678678
if app.is_inline:
679+
inline_height = app._get_inline_height()
680+
clear = (
681+
app._previous_inline_height is not None
682+
and inline_height < app._previous_inline_height
683+
)
679684
app._display(
680685
self,
681686
self._compositor.render_inline(
682-
app.size.with_height(app._get_inline_height()),
687+
app.size.with_height(inline_height),
683688
screen_stack=app._background_screens,
689+
clear=clear,
684690
),
685691
)
692+
app._previous_inline_height = inline_height
686693
self._dirty_widgets.clear()
687694
self._compositor._dirty_regions.clear()
688695
else:

0 commit comments

Comments
 (0)