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

Exploration: Overtype/Insert in different editors #233685

Open
aiday-mar opened this issue Nov 12, 2024 · 2 comments
Open

Exploration: Overtype/Insert in different editors #233685

aiday-mar opened this issue Nov 12, 2024 · 2 comments
Assignees
Labels
editor-core Editor basic functionality exploration

Comments

@aiday-mar
Copy link
Contributor

aiday-mar commented Nov 12, 2024

Overtype is implemented differently in different editors. This issue is meant as a central point to collect investigation results as to how different editors implement overtyping. There are major points that need to be analyzed:

  • overtype on type
    • with empty selection
    • with non-empty selection
  • overtype on paste
    • with empty selection
    • with non-empty selection
  • overtype on composition
    • with empty selection
    • with non-empty selection

Overtype extension

overtype on type with empty selection

Typing replaces the next character as they are typed
Unless we arrive to the end of a line in which case the next letters are inserted on the same line

overtype on type with non-empty selection

The selection is replaced by the letter you type and the next letter you type is replaced on the next character position.

overtype on paste

Has setting "overtype.paste" to toggle different paste behavior

The following are rules from the extension description. I was not able to reproduce the following, it requires overtype on paste to be activated:

  • If you paste part of a line of text into another line of text, the clipboard contents will overwrite characters until it's done pasting, unless it hits the end of the line first, in which case it'll just extend that line.
  • If you already have some text selected when you paste, that text will always be overwritten, even if the contents of the clipboard are smaller.
  • If you paste some multiline text into a line of text, everything left on that line will be overwritten with the first line of the pasted text, and the remaining pasted lines will be inserted below that line.
  • If you cut or copy using vscode's feature that grabs the entire line when you don't have anything selected, pasting that line will overwrite the entire line that you're pasting on.

overtype on composition

Type sennsei using the katakana keyboard, the first character is replaced, the next composition characters are inserted, not replaced.
Choosing between compositions replaces the composition without replacement
Accepting composition does not do replacement.

XCode

No overtype

Sublime text

keybindings: alt + cmd + o

overtype on type with empty selection

Typing past the current end of line continues inserting on the current line

overtype on type with non-empty selection

The selection is replaced with the current typed letter
Letter after selection is replaced with the next letter

overtype on paste

By default pasting inserts code.
When selection is made, the selection is replaced using the clipboard content.
No overtype on paste behavior.

overtype on composition

Composition in overtype mode will insert and choosing a composition will replace on accepting.

MacVim

overtype on type with empty selection

Overtypes the next word and when we get to the end of the line, continues by inserting

overtype on type with non-empty selection

Not sure how to do a selection and keep overtype mode?
As soon as I do a selection the overtype mode is disabled and I enter back into insert mode

overtype on paste

Enter into overtype mode using shift+r, then when you press cmd+v this will inserting text.

overtype on composition

As characters are added in a composition, the characters replace the existing characters. When you replace the remaining line with a composition, and then you choose a different composition, the composition is replaced, but the previous characters never appear again.

Vim in Termal MacOS

overtype on type with empty selection

Enter overtype mode using shift+r. Replace letters until the end of the line where typing inserts.

overtype on type with non-empty selection

Not sure how to make a selection in vim and keep replace mode

overtype on paste

While in replace mode, pasting will replace the characters.
If I paste a one-line piece of text, the text will replace until it reaches the end of the line and it will be inserted at the end
If I paste two-lines, the first line is pasted on the current line, the second line is pasted on the line below.

  • Suppose that in the original text editor, the line below has some text. The first line does replacement, and the next line is inserted (the next line does not do replacement). Even if the current line is longer than the first line of the pasted text, it is replaced entirely after the cursor by the first line of the pasted text.

overtype on composition

During composition, it is inserted. When it is accepted, the next characters are replaced.

TextMate

TextMate for MacOS does not seem to support this

Atom

Atom has no overtype mode

Notepad++

overtype on type with empty selection

Use OVR instead of INS from status bar. Inserting letters at the end after the end of the line.

overtype on type with non-empty selection

Selection is replaced by the letter and the next letter replaces the next letter after the selection.

overtype on paste

Pasting does insertion.

overtype on composition

Composition is rendered on top with a white box, when accepted it is later replaced.

@aiday-mar aiday-mar added editor-core Editor basic functionality exploration labels Nov 12, 2024
@aiday-mar aiday-mar self-assigned this Nov 12, 2024
@GitMensch
Copy link
Contributor

Is this intended to provide a solution path for #1012?

@aiday-mar
Copy link
Contributor Author

Yes I have a PR here which adds overtype mode #233188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-core Editor basic functionality exploration
Projects
None yet
Development

No branches or pull requests

2 participants