-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Adding overtype mode #233188
Adding overtype mode #233188
Conversation
LGTM, I'd really love to see this pulled in - @alexdima ? |
Pull Request is not mergeable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Looks almost ready to merge! Left a few small comments!
🚀 Nice! |
Finally! I know legions of users are rejoicing at this. Thank you, @aiday-mar for doing this. Now, I want to stress that I'm among those who are extremely grateful and appreciative of this work... but I have a question/request: How difficult would it be to add a setting that changes the behavior of the Backspace key when overtype is on? I think most of us have developed the muscle memory of hitting Backspace when we notice we've made a typo. It is so natural and fast for experienced touch-typists that we don't even consciously think of it, it just happens. OK, so if I'm overtype mode, it's because I don't want to disturb the positioning of anything that's already there. I start typing, my characters are overwriting things, and everything to the right of the cursor is staying put. Great. Oops, I mistyped a letter (or changed my mind) and my right pinky automatically shot out and hit Backspace. And now the stuff to the right of the cursor is out of alignment, which goes against my concept of what overtype is for. I can see three plausible behaviors for Backspace in overtype mode:
I could get used to either 2 or 3, so as far as I'm concerned, if one of those is significantly easier to implement, I'm happy to have just that one. (My guess is 2 is easier, because you could simply remap the Backspace key to left-arrow while overtype is on.) Thank you for reading this, and thank you again for the work you've already done. |
+1 about backspace behavior. I was very surprised when I pressed backspace after making a typo and the editor removed a character without leaving anything in its place, like I expect insert to behave. |
Hi @jkyeung and @junetried thank you for the comments and interesting ideas. I see what you mean. I am not sure about idea number 2. If backspace works like left arrow and does not remove anything, then what key will remove text? Idea number 3 is something I could implement. I have created a new issue to myself: #236191 |
For option 2, the usual way to remove text would be to back up, then press the Space bar as needed. (This is what I'm used to from certain terminal interfaces.) I agree it's perhaps less useful or efficient than replacing with whitespace as you go, but I could imagine option 3 being trickier because it should handle tabs and indentation sensibly, not just individual spaces. Not saying it's hard exactly, just that you may need to keep more things in mind when implementing it. For me, option 2 done correctly would be better than option 3 done incorrectly or incompletely. But sure, if you get it right, option 3 is probably the most desirable. |
fixes #1012