Skip to content

fix(explorer): reload executable stat #1427

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 3 commits into from
Jul 19, 2022
Merged

Conversation

klesh
Copy link
Contributor

@klesh klesh commented Jul 16, 2022

The NvimTreeRefresh command didn't refresh executable field of the node.

Step to reproduce:

  1. Open nvim-tree by :NvimTreeOpen
  2. Change the executable flag of any file by chmod command
  3. Execute :NvimTreeRefresh
  4. The style of the file node doesn't change at all while it should be

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.

Thanks for fixing this, i've noticed it many times and it was bothering me too

end
local n = nodes_by_path[abs]
n.executable = builders.is_executable(abs, n.extension)
Copy link
Member

Choose a reason for hiding this comment

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

check if n exists first please to make sure that this won't crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did. But I removed it before I created PR because I thought line 49 already covered the case.
What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

indeed but it still might not go into the conditionals, so make the check again :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done

@@ -62,7 +62,10 @@ function M.reload(node, status)
table.insert(node.nodes, link)
end
end

Copy link
Member

Choose a reason for hiding this comment

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

empty line to remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

Tested OK after refreshing. Consistent with other operations e.g. rename.

Will work automatically after #1431

@kyazdani42 kyazdani42 merged commit b754eb8 into nvim-tree:master Jul 19, 2022
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.

3 participants