Skip to content

Commit ff86eac

Browse files
fix(preview): add fallback title for special files and bump font cache
1 parent aa44efb commit ff86eac

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/rovr/core/preview_container.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
PREVIEWER_GROUP = "previewers"
6666
TEXT_PREVIEW_CACHE_VERSION = "windowed-v2"
67+
FONT_PREVIEW_CACHE_VERSION = "font-v2"
6768
BAT_PREVIEW_CACHE_VERSION = "paged-v2"
6869
BAT_PREVIEW_PAGE_SIZE = 256
6970
BAT_PREVIEWER_GROUP = "bat-pages"
@@ -410,7 +411,7 @@ def show_font_preview(self) -> None:
410411
)
411412
return
412413
signature = (
413-
f"{preview_utils.MAX_FONT_SIZE}:{config['interface']['font_preview']['font_size']}",
414+
f"{FONT_PREVIEW_CACHE_VERSION}:{preview_utils.MAX_FONT_SIZE}:{config['interface']['font_preview']['font_size']}",
414415
f"{self._preview_texts['font_text']}:{fg_color.hex}:{bg_color.hex}:{NewImage.func.__name__}",
415416
)
416417
img = _load_cached_image(realpath, "font", stat_result, signature)
@@ -1651,7 +1652,8 @@ def mount_special_messages(self) -> None:
16511652
return
16521653
self.log(self._mime_type)
16531654
assert isinstance(self._current_content, str)
1654-
self.set_border("title", "")
1655+
title = self._mime_type.method if self._mime_type else "Preview"
1656+
self.set_border("title", title)
16551657

16561658
display_content: str = self._current_content
16571659
if self._mime_type:

0 commit comments

Comments
 (0)