Skip to content

Commit ecb8257

Browse files
authored
Merge pull request #4091 from Textualize/text-area-default-theme
Use CSS by default in the TextArea
2 parents 7f1d0f8 + b3b1ce3 commit ecb8257

File tree

7 files changed

+74
-68
lines changed

7 files changed

+74
-68
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.48.1] - 2023-02-01
9+
10+
### Fixed
11+
12+
- `TextArea` uses CSS theme by default instead of `monokai` https://github.com/Textualize/textual/pull/4091
13+
814
## [0.48.0] - 2023-02-01
915

1016
### Changed
@@ -1621,6 +1627,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
16211627
- New handler system for messages that doesn't require inheritance
16221628
- Improved traceback handling
16231629

1630+
[0.48.1]: https://github.com/Textualize/textual/compare/v0.48.0...v0.48.1
16241631
[0.48.0]: https://github.com/Textualize/textual/compare/v0.47.1...v0.48.0
16251632
[0.47.1]: https://github.com/Textualize/textual/compare/v0.47.0...v0.47.1
16261633
[0.47.0]: https://github.com/Textualize/textual/compare/v0.46.0...v0.47.0

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.48.0"
3+
version = "0.48.1"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/_text_area_theme.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ def default(cls) -> TextAreaTheme:
187187
"""Get the default syntax theme.
188188
189189
Returns:
190-
The default TextAreaTheme (probably "monokai").
190+
The default TextAreaTheme (probably "css").
191191
"""
192-
return _MONOKAI
192+
return _CSS_THEME
193193

194194

195195
_MONOKAI = TextAreaTheme(

src/textual/widgets/_text_area.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def code_editor(
431431
text: str = "",
432432
*,
433433
language: str | None = None,
434-
theme: str | None = None,
434+
theme: str | None = "monokai",
435435
soft_wrap: bool = False,
436436
tab_behaviour: Literal["focus", "indent"] = "indent",
437437
show_line_numbers: bool = True,

tests/snapshot_tests/__snapshots__/test_snapshots.ambr

Lines changed: 61 additions & 61 deletions
Large diffs are not rendered by default.

tests/snapshot_tests/snapshot_apps/text_area_wrapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
class TextAreaWrapping(App):
2525
def compose(self) -> ComposeResult:
26-
yield TextArea.code_editor(TEXT, language="markdown", soft_wrap=True)
26+
yield TextArea.code_editor(TEXT, language="markdown", theme="monokai", soft_wrap=True)
2727

2828

2929
app = TextAreaWrapping()

tests/snapshot_tests/test_snapshots.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,7 @@ def setup_theme(pilot):
879879
@pytest.mark.syntax
880880
def test_text_area_wrapping_and_folding(snap_compare):
881881
assert snap_compare(
882-
SNAPSHOT_APPS_DIR / "text_area_wrapping.py",
883-
terminal_size=(20, 26)
882+
SNAPSHOT_APPS_DIR / "text_area_wrapping.py", terminal_size=(20, 26)
884883
)
885884

886885

0 commit comments

Comments
 (0)