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

Loading of read-only modules fails #116

Closed
phijor opened this issue Mar 5, 2023 · 0 comments · Fixed by #149
Closed

Loading of read-only modules fails #116

phijor opened this issue Mar 5, 2023 · 0 comments · Fixed by #149

Comments

@phijor
Copy link
Contributor

phijor commented Mar 5, 2023

Loading an Agda module in a read-only file (such as one in a system location) fails with the following error:

ErrorResult vim_command (ObjectArray [ObjectInt 0,ObjectString "Vim(write):E45: 'readonly' option is set (add ! to override)"])

I think the culprit is this line:

https://github.com/isovector/cornelis/blob/bfada15978fc7c0f0797ec3977c5069be4a22b0e/src/Plugin.hs#L85

Maybe the correct thing to do here is to execute the write silently (:h :silent!) and thus ignore any errors?

phijor added a commit to phijor/cornelis that referenced this issue May 14, 2024
Previously, loading buffers of read-only files wasn't possible, as
cornelis would try to write the file before loading (which would fail
and abort the command).

Add `silent` to the command to ignore failed writes.  This should be
a safe fallback.

Fixes agda#116.
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 a pull request may close this issue.

1 participant