Skip to content

Add 'Reason' to SelectionChangeEvent #8093

Closed

Description

@johnfn

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.

Activity

  1. changed the title [-]Feature request: OnClick[/-] [+]API request: OnClick[/+] on Jun 24, 2016
  2. jrieken commented on Jun 24, 2016

    @jrieken
    Contributor

    Not sure about onClick but we could enrich the TextEditorSelectionChangeEvent with some sort of hint

  3. johnfn commented on Jun 24, 2016

    @johnfn
    ContributorAuthor

    Yeah, that would be great.

  4. alexdima commented on Jun 28, 2016

    @alexdima
    Member

    fyi Johannes Rieken (@jrieken) - there is a ICursorSelectionChangedEvent.source - 'mouse' will be set there if the mouse handler or touch handler caused it. https://github.com/Microsoft/vscode/blob/master/src/vs/editor/browser/view/viewController.ts#L71

  5. changed the title [-]API request: OnClick[/-] [+]Add 'Reason' to SelectionChangeEvent[/+] on Jul 5, 2016
  6. added
    feature-request
    on Jul 13, 2016
  7. jrieken commented on Jul 13, 2016

    @jrieken
    Contributor

    alexandrudima I also see ICursorSelectionChangedEvent.reason. How are both reason and source related? Will source be set when reason is Paste?

  8. 10 remaining items

  9. removed this from the July 2016 milestone on Jul 25, 2016
  10. johnfn commented on Jul 26, 2016

    @johnfn
    ContributorAuthor

    Johannes Rieken (@jrieken) ah, super sorry! I have difficulty sorting through all my Github notifications. 😞

    mouse and/or onClick are by far the highest priority. The others are welcome if possible.

  11. jrieken commented on Jul 26, 2016

    @jrieken
    Contributor

    Thanks. I understand mouse as in 'user selected something' explicitly (not because of undo/redo, setting new content etc). Will make the changes early August such that we have enough time to fine tune

  12. johnfn commented on Jul 26, 2016

    @johnfn
    ContributorAuthor

    Exactly. Any click or release event, and explicitly not anything else.

  13. jrieken commented on Aug 12, 2016

    @jrieken
    Contributor

    Grant Mathews (@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

  14. johnfn commented on Aug 12, 2016

    @johnfn
    ContributorAuthor

    Johannes Rieken (@jrieken) ooh, this is a big one. I have been waiting on this for a while. Thanks!

  15. jrieken commented on Aug 15, 2016

    @jrieken
    Contributor

    Thanks and happy coding

  16. rebornix commented on Sep 20, 2016

    @rebornix
    Contributor

    Johannes Rieken (@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 TextEditorSelectionChangeKind is undefined, for example, when you insert a code snippet and all placeholders are selected, we receive a selection change with TextEditorSelectionChangeKind set as undefined. Any ideas?

  17. jrieken commented on Sep 21, 2016

    @jrieken
    Contributor

    That's the defined behaviour - there is no guarantee that the source is always known

  18. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

VIMapifeature-request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions