Skip to content

Add optional previewPath to file previewer #8

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

Merged
merged 1 commit into from
Mar 30, 2025

Conversation

tennashi
Copy link
Contributor

@tennashi tennashi commented Mar 29, 2025

This PR introduces an optional previewPath property in Detail, which allows specifying a custom preview path for files.
If the previewPath is provided, it will be used for previewing the file.
Otherwise, the path will be used as a fallback.

This change allows for scenarios where an item’s path is a directory. For example, when the path points to a directory, it enables the previewing of a specific file like README.md inside that directory.

This update is backward compatible, so it won't affect existing functionality.

If there are existing features that can achieve the same functionality, please let me know.

The test coverage check is failing, but there are no similar tests for this change in the builtin extension, so I have left it on hold for now.

Copy link

codecov bot commented Mar 29, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 51.46%. Comparing base (88d3c5a) to head (3f69a65).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
builtin/previewer/file.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
- Coverage   51.48%   51.46%   -0.03%     
==========================================
  Files          78       78              
  Lines        2317     2318       +1     
  Branches       70       70              
==========================================
  Hits         1193     1193              
- Misses       1124     1125       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -9,6 +9,7 @@ const decoder = new TextDecoder("utf-8", { fatal: true });

type Detail = {
path: string;
preview_path?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use previewPath instead

@tennashi tennashi changed the title Add optional preview_path to file previewer Add optional previewPath to file previewer Mar 30, 2025
@tennashi tennashi requested a review from lambdalisue March 30, 2025 03:36
@lambdalisue lambdalisue merged commit 1f3ebe1 into vim-fall:main Mar 30, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants