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

Command edition in Editor not working on MacOS if noclobber option is set #129

Closed
Mrngilles opened this issue Oct 11, 2021 · 3 comments
Closed
Assignees
Labels
bug Something isn't working verified This issue was already verified

Comments

@Mrngilles
Copy link

I've been trying to understand exactly why my edition in editor was not working anymore on mac, and after investigation, I did find out that since I have the option noclobber in my rcfile, the following line was actually trying to override an existing file:

echo "$BUFFER" > "$tmp_file"

I think this behaviour is Mac specific, and that there might be some strange behaviour happening with mktemp reusing files, even though you delete it.

I got it working by creating a custom widget, and simply replacing

  echo "$BUFFER" > "$tmp_file"

with

  echo "$BUFFER" >! "$tmp_file"

This solution should work no matter the status of the clobber option.

Hopefully that is clear enough a description. Please let me know if you need more information

@jeffreytse
Copy link
Owner

Hi @Mrngilles

Thanks for your issue, it's useful, and I will take a look as soon as possible. : )

Thanks and Regards

@jeffreytse jeffreytse self-assigned this Oct 13, 2021
@jeffreytse jeffreytse added bug Something isn't working verified This issue was already verified labels Oct 13, 2021
jeffreytse added a commit that referenced this issue Oct 13, 2021
Some users may config the noclobber option to prevent from
overwriting existing files with the > operator, we should use >!
operator to ignore the noclobber.
@jeffreytse
Copy link
Owner

Hi @Mrngilles

Thanks for your useful information, and now this issue has been fixed. You can update your plugin to the latest version. Hope you have a good day! : )

Thanks and Regards

@Mrngilles
Copy link
Author

works, thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified This issue was already verified
Projects
None yet
Development

No branches or pull requests

2 participants