Skip to content

Commit 6e7969f

Browse files
committed
Adjust Log.highlighter type to allow for custom highlighters.
Without an explicit type, tools like mypy assume Log.highlighter must be a ReprHighlighter instead of a Highlighter.
1 parent 322a85c commit 6e7969f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/textual/widgets/_log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import TYPE_CHECKING, Iterable, Optional, Sequence
55

66
from rich.cells import cell_len
7-
from rich.highlighter import ReprHighlighter
7+
from rich.highlighter import Highlighter, ReprHighlighter
88
from rich.segment import Segment
99
from rich.style import Style
1010
from rich.text import Text
@@ -70,7 +70,7 @@ def __init__(
7070
self._width = 0
7171
self._updates = 0
7272
self._render_line_cache: LRUCache[int, Strip] = LRUCache(1024)
73-
self.highlighter = ReprHighlighter()
73+
self.highlighter: Highlighter = ReprHighlighter()
7474
"""The Rich Highlighter object to use, if `highlight=True`"""
7575

7676
@property

0 commit comments

Comments
 (0)