mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
fix(log): add missing scroll_end to write_line
Add `scroll_end` parameter to the `Rich.write_line` method. The other write methods have this parameter, but must have been just overlooked for `write_line`.
This commit is contained in:
@@ -195,16 +195,21 @@ class Log(ScrollView, can_focus=True):
|
||||
self.scroll_end(animate=False, immediate=True, x_axis=False)
|
||||
return self
|
||||
|
||||
def write_line(self, line: str) -> Self:
|
||||
def write_line(
|
||||
self,
|
||||
line: str,
|
||||
scroll_end: bool | None = None,
|
||||
) -> Self:
|
||||
"""Write content on a new line.
|
||||
|
||||
Args:
|
||||
line: String to write to the log.
|
||||
scroll_end: Scroll to the end after writing, or `None` to use `self.auto_scroll`.
|
||||
|
||||
Returns:
|
||||
The `Log` instance.
|
||||
"""
|
||||
self.write_lines([line])
|
||||
self.write_lines([line], scroll_end)
|
||||
return self
|
||||
|
||||
def write_lines(
|
||||
|
||||
Reference in New Issue
Block a user