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

Autocommand errors #26

Closed
akinsho opened this issue May 30, 2020 · 2 comments · Fixed by #27
Closed

Autocommand errors #26

akinsho opened this issue May 30, 2020 · 2 comments · Fixed by #27

Comments

@akinsho
Copy link
Contributor

akinsho commented May 30, 2020

I've encountered a few autocommand errors whilst using nvim tree
tree-autocommand-error

and

nvim-tree-bug-msg

I'm not sure exactly how to reproduce either of them unfortunately I haven't had enough time to debug. The config I'm currently using is

let g:lua_tree_auto_close = 1 " 0 by default, closes the tree when it's the last window
let g:lua_tree_follow     = 1 " On bufEnter find the current file
let g:lua_tree_bindings = {
      \ "edit": "o",
      \}
let g:lua_tree_ignore = [ '.git', 'node_modules' ]

I've also noticed that when I save a buffer nvim seems to block for like 1-2seconds. When I disable nvim-tree things go back to normal.

Sorry this isn't too detailed I'll do some more digging when I get a chance and update this

@kyazdani42
Copy link
Member

okay i fixed the cursor position issue, which was an error in the order of function calls...
i didn't noticed for the save issue, but i didn't work on large repos, i tested on multiple repos at the same time and indeed, i found that refreshing git takes a long time, i'm gonna try optimize that, or i could make it asynchronous but i don't know if it would fix the issue properly.
Basically, i think the system calls to get the git status take too long to execute compared to the rest of the code, i don't really know if there is a way to fix this, i tried using the libuv spawn functions but they are non blocking and doing async in lua is quite a pain ...

@kyazdani42
Copy link
Member

actually looking at the code i just realized i'm calling those system function for every node, which is definitely wrong, they should only be called for each root of the git trees and bufferized, i will fix that asap :)

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 a pull request may close this issue.

2 participants