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

After opening and editing files with nvim in yazi, the preview is not updated automatically. #129

Closed
otakutyrant opened this issue Sep 10, 2023 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@otakutyrant
Copy link

I have to move the cursor between files to update the preview.

@sxyazi
Copy link
Owner

sxyazi commented Sep 10, 2023

This is intentional and a compromise for performance.

Currently, only changes in any one of the three elements (url, mime, skip) trigger a re-preview. It's simple to re-preview every time a file changes (content, permissions, owner, group, etc.), but it's not an efficient way.

@otakutyrant
Copy link
Author

My CPU is Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz and I do not feel any lag in preview when I move between items. Does this performance loss really matter?

@sxyazi
Copy link
Owner

sxyazi commented Sep 10, 2023

I really want this feature, but I'm not sure how to implement it at the moment. Please consider:

On an older machine where the current cursor file is continuously appended to at a millisecond level, how should Yazi handle re-previews?

Should it frequently spawn processes for files like videos and PDFs that rely on other tools (ffmpegthumbnailer, poppler, etc.)?

@otakutyrant
Copy link
Author

otakutyrant commented Sep 10, 2023

Maybe the title is not clear, I mean I open a file with neovim in yazi, edit it explicitly, and quit, the preview is not updated as expected. So just trigger update when I quit and the files is changed, and it is uncessary to supervise the file at other time.

@sxyazi
Copy link
Owner

sxyazi commented Sep 10, 2023

The preview is triggered by a watcher, which relies on file change notifications from the operating system and is independent of whether the file is opened.

If you expect that the preview should only be re-previewed when a file is opened and its content changes, I believe this is not a good way. It would lead to inconsistent preview behavior, meaning that any other method causing a content change would not trigger a re-preview.

@sxyazi sxyazi mentioned this issue Sep 11, 2023
55 tasks
@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Sep 11, 2023
@sxyazi sxyazi added this to the v0.1.6 milestone Oct 13, 2023
@sxyazi sxyazi added enhancement New feature or request and removed waiting on op Waiting for more information from the original poster labels Oct 13, 2023
@sxyazi
Copy link
Owner

sxyazi commented Nov 23, 2023

Fixed by #360

@sxyazi sxyazi closed this as completed Nov 23, 2023
Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants