vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Expose the current editor overtype state

Open lppedd opened this issue 1 year ago • 9 comments

When dealing with webviews using the standalone version of Monaco Editor, we'd like to align our environment with the current VS Code state. That means if the user is currently using overtype mode, that should be activated by default in our webviews.

We'd like to have access to:

  • inputMode: 'insert' | 'overtype'
  • onDidChangeInputMode(...)

lppedd avatar Dec 16 '24 11:12 lppedd

Also - please consider to not make this a setting directly but (from the model) local to the current editor window.

This will allow to optionally provide a setting later (was already requested) to toggle overtype mode per editor, not for vscode altogether.

GitMensch avatar Dec 16 '24 12:12 GitMensch

@GitMensch Wouldn't that mean having two states? One global, and one per editor?

If it's only going to be per editor, my request doesn't seem to make sense anymore. I might have misunderstood your comment tho.

lppedd avatar Dec 16 '24 12:12 lppedd

One per editor, with the overtype key(s) toggling either all editors at once (current behavior) or only a single one, depending on a new setting like editor.overtypeToggleSingleEditor. Note that this new non-default setting is requested both in the referenced issue and is a feature of the Overtype extension which also added that because of user request in the first place.

It seems necessary to have an overtype state per editor in its "model" to be able to implement that option.

GitMensch avatar Dec 16 '24 14:12 GitMensch

Maybe I've never encountered the use case, but to me having n states for n editors seems unnecessary complex as built-in behavior.
My opinion is it should stay under https://github.com/DrMerfy/vscode-overtype.

lppedd avatar Dec 16 '24 15:12 lppedd

I'm fine with this approach (but in this case there should be a good way of using it by disabling the internal overtype handling - haven't tried but it seems there are problems with that).

In theory that extension may could query/set the global state depending on the editor currently active - but for now we can't query/set the mode, as you've outlined in the topic start.

GitMensch avatar Dec 16 '24 15:12 GitMensch

Any news on this? Even a workaround/hack would be nice to have.

lppedd avatar Jun 11 '25 14:06 lppedd

The news seems that this is now in the backlog, along with > 4.6k others...

GitMensch avatar Jun 11 '25 14:06 GitMensch

It's really painful as I also have to stop events from escaping the webview context, otherwise I screw up the VS Code overtype state.

lppedd avatar Jun 11 '25 14:06 lppedd

Can this be prioritized please? Not sure how we can build decent UXs without this.

lppedd avatar Dec 10 '25 16:12 lppedd