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

[Bug]: App was not killed after NeoVim was terminated. #249

Closed
Thiago4532 opened this issue Nov 28, 2023 · 2 comments
Closed

[Bug]: App was not killed after NeoVim was terminated. #249

Thiago4532 opened this issue Nov 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Thiago4532
Copy link

What happened?

image
After closing the terminal, the app wasn't closed. I was able to reproduce this after accidentally opening a Markdown file in my home directory and the app froze for some seconds (I assume it was traversing the directory, but traversing home is expensive). While it was scanning I closed the terminal and the app continued to run.

How were you expecting the plugin to behave?

After the app unfreezes, or even before it does, it should detect that NeoVim was closed and terminate itself.

Also it would be nice if I was able to open Markdown files at home directory without the whole app freezing, since it's running in single-file mode I can't see a reason to take so long to open the file when in the home directory. Is this a bug too?

:checkhealth

github-preview: require("github-preview.health").check()

github-preview.nvim ~
- platform: arch
- ERROR failed to read git-commit hash
- OK bun: 1.0.14
@Thiago4532 Thiago4532 added the bug Something isn't working label Nov 28, 2023
@wallpants
Copy link
Owner

Thanks a lot for the included details 🚀

Sorry I've been out, but I'll take a look at this during this week.

I agree with you, it'd be nice to be able to open markdown files in the home directory without any lag, specially when running the plugin in single-file mode.

wallpants added a commit that referenced this issue Dec 25, 2023
Even if single-file mode was enabled, we were still trying to find a git repository root. In some cases, depending on the cwd of the user, the search could take a while and it would seem like the app froze. Now if the user explicitly enabled single-file mode, we don't even try searching for a repository root.

re #249
@wallpants
Copy link
Owner

The plugin has been updated to not try and look for a repository root if single-file mode has been explicitly enabled in your plugin config. This should speed up startup in some cases.

I have not been able to reproduce the app not being killed. I would like to believe that Neovim freezing and being unable to notify the app to shut down is not going to be a common issue. Also if you were to try starting the app again in the same neovim instance or any other neovim instances, the previously ran plugin will be shut down and a new instance will be started. The new instance should die down when your neovim instance exits.

I'm going to mark this issue as resolved. I hope the quicker startup will prevent your Neovim from freezing and having a zombie app running in the background. If you encounter this again, please feel free to open an issue and I'll look into it again.

wallpants added a commit that referenced this issue Dec 25, 2023
Even if single-file mode was enabled, we were still trying to find a git repository root. In some cases, depending on the cwd of the user, the search could take a while and it would seem like the app froze. Now if the user explicitly enabled single-file mode, we don't even try searching for a repository root.

re #249
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants