-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Add 'Reason' to SelectionChangeEvent #8093
Comments
Not sure about |
Yeah, that would be great. |
fyi @jrieken - there is a |
@alexandrudima I also see |
I need some naming inspiration for this one... I wonder if export enum TextEditorSelectionModifier {
Keyboard = 1,
Mouse = 2
}
export interface TextEditorSelectionChangeEvent {
modifiedBy?: TextEditorSelectionModifier;
textEditor: TextEditor;
selections: Selection[];
} Then looking at the editor the source is a string which can be arbitrary, like |
@jrieken what if multiple extensions want to tweak the selection in response to a keyboard or mouse selection change? The extensions could check for (I think you mean for |
I don't understand that how that relates to |
@jrieken I'm talking about the current situation, not the proposed change. Sorry it was tangential, but Unless you wait for one handler to complete before calling another, I'm pretty sure the outcome is nondeterministic. But maybe the right answer is as you suggeted: "don't retrigger an event while processing it." In which case I need to make a feature-request for modifying selections before they are applied... |
Yeah, that's a different thing because the extension host is only being informed about selection changes and isn't part of the select-operation. |
@jrieken I have complete confidence I can leave this issue entirely to you |
@jrieken ah, super sorry! I have difficulty sorting through all my Github notifications. 😞
|
Thanks. I understand |
Exactly. Any click or release event, and explicitly not anything else. |
@johnfn I have just pushed the change to master. It would be great if you can give it try with tomorrows insider build and give feedback |
@jrieken ooh, this is a big one. I have been waiting on this for a while. Thanks! |
Thanks and happy coding |
@jrieken I've played with this new API change and most cases work perfectly. The only problem I've run into right now is sometimes |
That's the defined behaviour - there is no guarantee that the source is always known |
In the process of working on a Vim plugin for VSCode I've run into a number of areas where I need a little bit of API help. Apologies if any of my suggestions already exist!
One thing that I would really like is an
onClick
event. I know that we have a way to see if selections are changed, but the difficulty is that the Vim plugin changes the selections a lot, which makes it difficult to know who changed the selections - me or you.onClick
would solve this problem.The text was updated successfully, but these errors were encountered: