Skip to content

Customisable double click-select behaviour #2036

Closed

Description

@d0x2f

Upon double-clicking, people have different expectations across various languages.
The ability to define custom highlighting rules based on the selected text would simultaneously solve a lot of highlighting issues and increase the flexibility of the editor.

My motivation for bringing this up comes from my frustration with variable selection in PHP.
When double-clicking 'foo' in '$foo->bar()' you will end up selecting '$foo-', my preference would be 'foo'.
I also noticed another issue regarding double clicking white-space where the user would like it to select all connected white-space.
These kinds of rules would be perfectly suited for on the fly user customisation.

Activity

  1. added
    feature-request
    on Jan 15, 2016
  2. vlad-saling commented on Jan 29, 2016

    @vlad-saling

    I would love to see that as well. Sometimes I need to replace just part of the string. For example a part of class name in CSS like .block--modifier but the default double click selects whole class. Making the behavior customizable would solve this.

  3. luebken commented on Mar 4, 2016

    @luebken

    May I add a simple use case: The first time I select a string via douple-click I would like the selection to exclude the double quotes.

  4. jtarbox commented on Mar 8, 2016

    @jtarbox

    I noticed a change with the recent update with how this behaved. For PHP, could we have this as an editable option or something? As I would personally prefer it grab the preceding '$' character when double-click selecting.

  5. alexdima commented on Mar 8, 2016

    @alexdima
    Member

    Jonathan Tarbox (@jtarbox) Yes, please try changing the following setting that now customizes word definitions when doing word operations:

    // default:
    , "editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"
    // without $:
    , "editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?"
    
  6. alexdima commented on Mar 8, 2016

    @alexdima
    Member

    Actually, I think the new option editor.wordSeparators that just shipped with 0.10.11 resolves this issue

  7. jtarbox commented on Mar 8, 2016

    @jtarbox

    thx, worked perfectly! (still getting used to the text based settings)

  8. vlad-saling commented on Mar 10, 2016

    @vlad-saling

    Thank you! Works great!

  9. ctrulove commented on Mar 29, 2016

    @ctrulove

    This just made my day. Works like a charm.

  10. RonanCodes commented on Nov 30, 2016

    @RonanCodes

    This is great, I removed the dollar for angular coding.
    Is there a way to specify this for different languages?
    Or do I need to edit my settings file each time I change language?

  11. Ben-Conrad commented on Jan 25, 2017

    @Ben-Conrad

    This is great, I removed '$' from editor.wordSeparators and now I can double click on PowerShell variables and get the entire variable '$var' in my clipboard.

  12. dmagician commented on Feb 23, 2017

    @dmagician

    Fantastic configuration feature. I have immediatelly removed $ from that ;-) I'm used to $variable being selected ;-)

  13. gstvux commented on Jun 14, 2017

    @gstvux

    These days I came across this issue of double click behavior. I noticed that most of the time I would like to "select the whole string", but it was annoying me. So, what if I double click on a "-" and the behavior would be something like "select an entire string". If I clicked on a word (as we usually do) would I still have the default behavior?

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

Metadata

Metadata

Labels

feature-requestlanguages-basic

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions