Skip to content

Commit d1f6a15

Browse files
committed
Use Textual's TextArea.code_editor if available
Textual 0.48 introduces a breaking change for the `TextArea` widget: line wrapping is now enabled by default. Since we don't want line wrapping, we need to disable that. Fortunately, a new alternative constructor called `TextArea.code_editor` is introduced, and constructing the `TextArea` using it retains the old behavior. Unfortunately, that alternative constructor didn't exist prior to Textual 0.48, so we need to conditionally fall back to simply using the `TextArea` constructor when `TextArea.code_editor` doesn't exist. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
1 parent e36f315 commit d1f6a15

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/memray/reporters/tree.py

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def compose(self) -> ComposeResult:
181181
text.show_line_numbers = False
182182
text.can_focus = False
183183
text.cursor_blink = False
184+
text.soft_wrap = False
184185

185186
labels: list[Label] = []
186187
content_by_label_id = self._get_content_by_label_id()

0 commit comments

Comments
 (0)