Skip to content

Commit

Permalink
Merge pull request #4091 from Textualize/text-area-default-theme
Browse files Browse the repository at this point in the history
Use CSS by default in the TextArea
  • Loading branch information
willmcgugan authored Feb 1, 2024
2 parents 7f1d0f8 + b3b1ce3 commit ecb8257
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 68 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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.48.1] - 2023-02-01

### Fixed

- `TextArea` uses CSS theme by default instead of `monokai` https://github.com/Textualize/textual/pull/4091

## [0.48.0] - 2023-02-01

### Changed
Expand Down Expand Up @@ -1621,6 +1627,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.48.1]: https://github.com/Textualize/textual/compare/v0.48.0...v0.48.1
[0.48.0]: https://github.com/Textualize/textual/compare/v0.47.1...v0.48.0
[0.47.1]: https://github.com/Textualize/textual/compare/v0.47.0...v0.47.1
[0.47.0]: https://github.com/Textualize/textual/compare/v0.46.0...v0.47.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.48.0"
version = "0.48.1"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
4 changes: 2 additions & 2 deletions src/textual/_text_area_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ def default(cls) -> TextAreaTheme:
"""Get the default syntax theme.
Returns:
The default TextAreaTheme (probably "monokai").
The default TextAreaTheme (probably "css").
"""
return _MONOKAI
return _CSS_THEME


_MONOKAI = TextAreaTheme(
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_text_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def code_editor(
text: str = "",
*,
language: str | None = None,
theme: str | None = None,
theme: str | None = "monokai",
soft_wrap: bool = False,
tab_behaviour: Literal["focus", "indent"] = "indent",
show_line_numbers: bool = True,
Expand Down
122 changes: 61 additions & 61 deletions tests/snapshot_tests/__snapshots__/test_snapshots.ambr

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/snapshot_tests/snapshot_apps/text_area_wrapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

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


app = TextAreaWrapping()
Expand Down
3 changes: 1 addition & 2 deletions tests/snapshot_tests/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,7 @@ def setup_theme(pilot):
@pytest.mark.syntax
def test_text_area_wrapping_and_folding(snap_compare):
assert snap_compare(
SNAPSHOT_APPS_DIR / "text_area_wrapping.py",
terminal_size=(20, 26)
SNAPSHOT_APPS_DIR / "text_area_wrapping.py", terminal_size=(20, 26)
)


Expand Down

0 comments on commit ecb8257

Please sign in to comment.