-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Allow toggling "watch_gitdir" or dynamically changing watch interval #822
Comments
Can't you just disable I'm really not interested in adding a dynamic. Having a poll object for each open buffer shouldn't use much CPU. |
Well, the watcher does create many |
Are you talking about the cwd_watcher or the gitdir watcher? The gitdir_watcher can be disabled. |
Oops, I think I may traced the wrong code 😅 I tried to reduce the |
I know I can disable |
There are a few improvements we can make:
I've raised #823 to track this. I don't plan on working on this soon, so PR's would be welcome if you're feeling up to it. |
Thanks! I'm not familiar with libuv, but I can try stopping watchers when nvim is backgrounded when I have free time. |
Is your feature request related to a problem? Please describe.
I work for the project that consisted of many small git repos. Usually I open each neovim instance for each git repo and switch between them. I would like to avoid or lower the CPU usage of gitsigns.nvim "watch_gitdir" in background neovim instances.
Describe the solution you'd like
A command to toggle "watch_gitdir" or change "watch_gitdir" interval.
Describe alternatives you've considered
Automatically disable "watch_gitdir" in background neovim instances.
Additional context
I've tried to implement this in my config by trying to change directory to non-git directory on FocusLost and changing back on FocusGained. But the debounced
update_cwd_head
function seems not called when triggered this way.The text was updated successfully, but these errors were encountered: