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

Set buftype=nowrite for otter buffers #30

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Set buftype=nowrite for otter buffers #30

merged 1 commit into from
Apr 25, 2023

Conversation

yongrenjie
Copy link
Contributor

Hello!

I've been experiencing issue #7, and the fact that I can't consistently reproduce it either is quite annoying. However, I think this PR should fix it! :h buftype describes the nowrite option:

The buffer is not to be written to disk, ":w" doesn't work (":w filename" does work though).
The buffer is never considered to be |'modified'|. There is no warning when the changes will be lost, for example when you quit Vim.

An added bonus is that it's no longer necessary to delete these files upon exiting, because it is not possible to save it.

So far it's working fine for me and I haven't run into the issue again, but I'll attach the caveat that I don't use Quarto regularly enough to be fully confident in saying that it'll never happen. 😄

@jmbuhr
Copy link
Owner

jmbuhr commented Apr 25, 2023

This is amazing, thank you very much! I had previously experimented with nowrite and couldn't get it to work because it would interfer with set_lines. I probably set the option the wrong way.

No errors so far on my side as well.

Fixes #7

@jmbuhr jmbuhr merged commit ee2f5f6 into jmbuhr:main Apr 25, 2023
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.

None yet

2 participants