Skip to content

Fix tree refreshing logic #739

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
Oct 23, 2021
Merged

Fix tree refreshing logic #739

merged 1 commit into from
Oct 23, 2021

Conversation

yehy4
Copy link
Contributor

@yehy4 yehy4 commented Oct 22, 2021

This PR contains one commit to fix an issue in the logic that is used to prevent too many refreshes during a short period of time.

Before this commit, when lib.refresh_tree() is called with disable_clock = true (for example by typing R in the tree's window), refreshing gets set to true. However, nothing sets refreshing to false afterwards because the if statement evaluates to false. This results in subsequent calls to lib.refresh_tree() with disable_clock = false (for example through :NvimTreeRefresh) to exit the function early and therefore not actually update the tree.

The proposed fix in this commit is to simply set refreshing to false unconditionally (i.e., regardless of the disable_clock value).

P.S.: Thank you for you for creating and maintaining this great plugin!

Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

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

seen that indeed, was fixed in a big refacto i was doing, but still merging this in the meantime

@kyazdani42 kyazdani42 merged commit 5014f59 into nvim-tree:master Oct 23, 2021
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
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