diff options
Diffstat (limited to 'libs/rich/_log_render.py')
-rw-r--r-- | libs/rich/_log_render.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/rich/_log_render.py b/libs/rich/_log_render.py index 67579633a..e8810100b 100644 --- a/libs/rich/_log_render.py +++ b/libs/rich/_log_render.py @@ -33,12 +33,12 @@ class LogRender: self, console: "Console", renderables: Iterable["ConsoleRenderable"], - log_time: datetime = None, - time_format: Union[str, FormatTimeCallable] = None, + log_time: Optional[datetime] = None, + time_format: Optional[Union[str, FormatTimeCallable]] = None, level: TextType = "", - path: str = None, - line_no: int = None, - link_path: str = None, + path: Optional[str] = None, + line_no: Optional[int] = None, + link_path: Optional[str] = None, ) -> "Table": from .containers import Renderables from .table import Table @@ -75,7 +75,11 @@ class LogRender: path, style=f"link file://{link_path}" if link_path else "" ) if line_no: - path_text.append(f":{line_no}") + path_text.append(":") + path_text.append( + f"{line_no}", + style=f"link file://{link_path}#{line_no}" if link_path else "", + ) row.append(path_text) output.add_row(*row) |