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

When switch to insert mode cancel if buffer is readonly #40

Closed
olymk2 opened this issue Aug 28, 2018 · 6 comments
Closed

When switch to insert mode cancel if buffer is readonly #40

olymk2 opened this issue Aug 28, 2018 · 6 comments

Comments

@olymk2
Copy link

olymk2 commented Aug 28, 2018

When I am in a buffer using command mode and switch to insert mode if the buffer is read only it causes issues.

Basically it should stay in command mode currently it seems to leave me in a mode that is neither insert or command mode so my keybindings no longer work.

Perhaps check current buffers status before changing mode no sense even trying to use insert mode if the buffer is read only.

@jyp jyp closed this as completed in d96c37d Aug 29, 2018
@jyp
Copy link
Owner

jyp commented Aug 29, 2018

Thanks for your suggestion!

@olymk2
Copy link
Author

olymk2 commented Aug 29, 2018

awesome that was quick, I will give it a try :)

@aspiwack
Copy link
Collaborator

aspiwack commented Sep 5, 2018

(sorry to be late to the party, I'm slowly emerging from my holidays)

This is probably a bad idea, actually. It seems fairly common to create read-only buffer with custom key bindings (the magit-blame buffer is of this nature, I believe) the ability to turn to the insert state is a stop-gap measure to interact with such buffer when they are not recognised as requiring special state.

@olymk2 what are the issues you were referring to in your original request?

@olymk2
Copy link
Author

olymk2 commented Sep 5, 2018

basically it fails to switch to insert mode, and command mode no longer works so all my bindings no longer work.

Means i get stuck trying to remember the original emacs bindings because it fails to switch but does not maintain the current command state

@aspiwack
Copy link
Collaborator

aspiwack commented Sep 6, 2018

Ouch! That's pretty unpleasant. I wonder why that is, though. But anway, I retract my objection, and if I get bitten by it, I'll report back in a separate issue.

@jyp
Copy link
Owner

jyp commented Sep 7, 2018 via email

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

No branches or pull requests

3 participants