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

Expose the current editor overtype state #236218

Open
lppedd opened this issue Dec 16, 2024 · 5 comments
Open

Expose the current editor overtype state #236218

lppedd opened this issue Dec 16, 2024 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-input Editor text input

Comments

@lppedd
Copy link

lppedd commented Dec 16, 2024

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(...)
@aiday-mar aiday-mar self-assigned this Dec 16, 2024
@aiday-mar aiday-mar added editor-input Editor text input bug Issue identified by VS Code Team member as probable bug labels Dec 16, 2024
@GitMensch
Copy link
Contributor

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.

@lppedd
Copy link
Author

lppedd commented Dec 16, 2024

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

@GitMensch
Copy link
Contributor

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.

@lppedd
Copy link
Author

lppedd commented Dec 16, 2024

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.

@GitMensch
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug editor-input Editor text input
Projects
None yet
Development

No branches or pull requests

3 participants