Skip to content

Commit

Permalink
version bump and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Apr 7, 2024
1 parent 1a7f9ff commit 4d862c7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.56.2] - 2024-04-07

### Fixed

- Fixed inline mode not clearing with multiple screen

## [0.56.1] - 2024-04-07

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

[0.56.2]: https://github.com/Textualize/textual/compare/v0.56.1...v0.56.2
[0.56.1]: https://github.com/Textualize/textual/compare/v0.56.0...v0.56.1
[0.56.0]: https://github.com/Textualize/textual/compare/v0.55.1...v0.56.0
[0.55.1]: https://github.com/Textualize/textual/compare/v0.55.0...v0.55.1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.56.1"
version = "0.56.2"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
14 changes: 4 additions & 10 deletions src/textual/_compositor.py
Expand Up @@ -184,7 +184,6 @@ def render_segments(self, console: Console) -> str:
else:
append("\r")
append("\x1b[6n") # Query new cursor position

return "".join(sequences)


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

# Size of previous inline update
self._previous_inline_height: int | None = None

@classmethod
def _regions_to_spans(
cls, regions: Iterable[Region]
Expand Down Expand Up @@ -1023,7 +1019,10 @@ def render_update(
return self.render_partial_update()

def render_inline(
self, size: Size, screen_stack: list[Screen] | None = None
self,
size: Size,
screen_stack: list[Screen] | None = None,
clear: bool = False,
) -> RenderableType:
"""Render an inline update.
Expand All @@ -1036,11 +1035,6 @@ def render_inline(
"""
visible_screen_stack.set([] if screen_stack is None else screen_stack)
strips = self.render_strips(size)
clear = (
self._previous_inline_height is not None
and len(strips) < self._previous_inline_height
)
self._previous_inline_height = len(strips)
return InlineUpdate(strips, clear=clear)

def render_full_update(self) -> LayoutUpdate:
Expand Down
3 changes: 3 additions & 0 deletions src/textual/app.py
Expand Up @@ -637,6 +637,9 @@ def __init__(
happens.
"""

# Size of previous inline update
self._previous_inline_height: int | None = None

def validate_title(self, title: Any) -> str:
"""Make sure the title is set to a string."""
return str(title)
Expand Down
9 changes: 8 additions & 1 deletion src/textual/screen.py
Expand Up @@ -676,13 +676,20 @@ def _compositor_refresh(self) -> None:

if self is app.screen:
if app.is_inline:
inline_height = app._get_inline_height()
clear = (
app._previous_inline_height is not None
and inline_height < app._previous_inline_height
)
app._display(
self,
self._compositor.render_inline(
app.size.with_height(app._get_inline_height()),
app.size.with_height(inline_height),
screen_stack=app._background_screens,
clear=clear,
),
)
app._previous_inline_height = inline_height
self._dirty_widgets.clear()
self._compositor._dirty_regions.clear()
else:
Expand Down

0 comments on commit 4d862c7

Please sign in to comment.