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

Feature request: Option/Toggle to make the editor read only when the underlying file is read only. #20

Closed
henrik-jensen opened this issue Feb 27, 2020 · 6 comments
Labels
depends on Depends on issues from VS Code enhancement out of scope

Comments

@henrik-jensen
Copy link

There is a long time request for an Add read-only mode enhancement request to vscode for a toggle to make the editor (buffer) read only.
I wonder if this extension, as an option, could toggle the built in readOnly Editor option, see [2.], when it detects a readonly file?

Some links of possible interest:

  1. A comment by @ctf0 that refers to your extension.
  2. A comment by @alexdima on the rejected read-only mode PR with a link to the built in readOnly Editor option.
@alefragnani
Copy link
Owner

Hi @henrik-jensen ,

Unfortunately not. There is no readOnly attribute available, neither a way to change the file access of the editor (buffer) .

I understand that that issue is complex, and may have a bunch of scenarios to take care of, but I wonder why single, read-only files aren’t opened as read-only (non editable) yet. BTW, there is an open issue here.

Maybe upvoting the last one would make it easier to be released 😃 .

Hope this helps.

PS. Once microsoft/vscode#17670 is release, toggling read-only/writeable would update the editor automagically

@alefragnani alefragnani added depends on Depends on issues from VS Code enhancement labels Feb 27, 2020
@henrik-jensen
Copy link
Author

henrik-jensen commented Feb 28, 2020

So the readOnly property is only available internally and not for extensions?

Anyway, upvoted microsoft/vscode#17670
Maybe there is hope, though that issue is almost as old as microsoft/vscode#4873.

Thx for the response and link.

@alefragnani
Copy link
Owner

Yes, it is :-(

Let’s see what the VS Code team have planned for the next releases. With so much effort in Remote Development scenarios, maybe we see improvements in FileSystem info, and this readOnly attribute may end up with newer APIs.

I have upvoted/subscribed to that issues too..

@funkiestj
Copy link

As an emacs user, I really love being able to toggle a buffer read only even when the file is writable. Vim also have the option to open a file as a "read only" buffer (vim -R )

@alefragnani
Copy link
Owner

Hi @funkiestj ,

I'm not an emacs/vim user, but from time to time I also need to toggle read-only state for the buffer, but unfortunately, the VSCode issue microsoft/vscode#4873 is still open, with no ETA.

You may upvote/subscribe on that issue, so you would be notified on updates.

Hope this helps

@funkiestj
Copy link

You may upvote/subscribe on that issue, so you would be notified on updates.

upvoted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depends on Depends on issues from VS Code enhancement out of scope
Projects
None yet
Development

No branches or pull requests

3 participants