Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Log.highlighter type to allow for custom highlighters. #5046

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/textual/widgets/_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import TYPE_CHECKING, Iterable, Optional, Sequence

from rich.cells import cell_len
from rich.highlighter import ReprHighlighter
from rich.highlighter import Highlighter, ReprHighlighter
from rich.segment import Segment
from rich.style import Style
from rich.text import Text
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(
self._width = 0
self._updates = 0
self._render_line_cache: LRUCache[int, Strip] = LRUCache(1024)
self.highlighter = ReprHighlighter()
self.highlighter: Highlighter = ReprHighlighter()
"""The Rich Highlighter object to use, if `highlight=True`"""

@property
Expand Down
Loading