Skip to content

fix: remove redundant file existence check in create file operation #1936

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
Jan 23, 2023

Conversation

yioneko
Copy link
Contributor

@yioneko yioneko commented Jan 23, 2023

See #1870 (comment).

For backward compatibility, when the file already exists, use early return instead of prompting to overwrite.

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:

  • create normally
  • create already exists
  • create failure

@alex-courtis
Copy link
Member

Thanks for raising this one. It will make things simpler in the future.

@alex-courtis alex-courtis merged commit 16f2806 into nvim-tree:master Jan 23, 2023
@alex-courtis
Copy link
Member

I know that we should test the fd returned by the pcall, however that is a change for Another Day.

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