Skip to content

Adding overtype mode - #233188

Merged
Aiday Marlen Kyzy (aiday-mar) merged 45 commits into
mainfrom
nuclear-swallow
Nov 29, 2024
Merged

Aiday Marlen Kyzy (aiday-mar) merged 45 commits into
mainfrom
nuclear-swallow

Conversation

@aiday-mar

@aiday-mar Aiday Marlen Kyzy (aiday-mar) commented Nov 6, 2024 •

Copy link
Copy Markdown
Contributor

fixes #1012

@aiday-mar Aiday Marlen Kyzy (aiday-mar) changed the title Adding setting to enable overtype mode [DRAFT]: Adding setting to enable overtype mode Nov 6, 2024
@aiday-mar Aiday Marlen Kyzy (aiday-mar) changed the title [DRAFT]: Adding setting to enable overtype mode Adding overtype mode Nov 13, 2024
@aiday-mar
Aiday Marlen Kyzy (aiday-mar) marked this pull request as ready for review November 13, 2024 16:16
@aiday-mar
Aiday Marlen Kyzy (aiday-mar) marked this pull request as draft November 13, 2024 16:16
@GitMensch

Copy link
Copy Markdown
Contributor

LGTM, I'd really love to see this pulled in - Alexandru Dima (@alexdima) ?

auto-merge was automatically disabled November 26, 2024 09:18

Pull Request is not mergeable

@alexdima Alexandru Dima (alexdima) left a comment •

Copy link
Copy Markdown
Member

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!

Comment thread src/vs/workbench/browser/parts/editor/editorStatus.ts Outdated
Comment thread src/vs/workbench/browser/parts/editor/editorStatus.ts Outdated
Comment thread src/vs/workbench/browser/parts/editor/editorActions.ts Outdated
@alexdima

Copy link
Copy Markdown
Member

🚀 Nice!

@jkyeung

jkyeung commented Dec 11, 2024

Copy link
Copy Markdown

Finally! I know legions of users are rejoicing at this. Thank you, Aiday Marlen Kyzy (@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:

  1. Status quo. I'm sure plenty of users are happy with this. I also suspect plenty of users would rather it not be this, but have gotten used to it; and either it doesn't occur to them that there could be something better, or they're resigned to the way things are.
  2. Behave like left-arrow. This includes jumping over indentation consisting of spaces, if that setting is on.
  3. Like regular Backspace, except that stuff to the right of the cursor stays where it is (by inserting whitespace as necessary). You might also think of this as "destructive" left-arrow.

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.

@junetried

Copy link
Copy Markdown

+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.

@aiday-mar

Aiday Marlen Kyzy (aiday-mar) commented Dec 16, 2024 •

Copy link
Copy Markdown
Contributor Author

Hi jkyeung and June (@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

@jkyeung

jkyeung commented Dec 16, 2024

Copy link
Copy Markdown

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.

@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insert key doesn't switch to overtype/overwrite mode

6 participants