From 9092095bc67aa598a62835b3a36c131c7e6af36e Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 28 Dec 2022 10:27:59 +0000 Subject: [PATCH] fix and bump --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- src/textual/widgets/_text_log.py | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7681b1462..aff340411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.8.2] - 2022-12-28 + +### Fixed + +- Fixed issue with TextLog.clear() https://github.com/Textualize/textual/issues/1447 + ## [0.8.1] - 2022-12-25 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index f1882d755..a005743e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "textual" -version = "0.8.1" +version = "0.8.2" homepage = "https://github.com/Textualize/textual" description = "Modern Text User Interface framework" authors = ["Will McGugan "] diff --git a/src/textual/widgets/_text_log.py b/src/textual/widgets/_text_log.py index 980df5f4c..46cd670c5 100644 --- a/src/textual/widgets/_text_log.py +++ b/src/textual/widgets/_text_log.py @@ -131,7 +131,8 @@ class TextLog(ScrollView, can_focus=True): def clear(self) -> None: """Clear the text log.""" - del self.lines[:] + self.lines.clear() + self._line_cache.clear() self._start_line = 0 self.max_width = 0 self.virtual_size = Size(self.max_width, len(self.lines))