#908 Allow whole-word selection to work with multiple selections

Scintilla (796)
Jason Ray

Multiple selections work great when using ctrl+click-drag to select, but don't work with ctrl+double-click.
Each ctrl+double-click action clears the existing selection before selecting the word.

I think it would be really useful to allow ctrl+double-click to add to a multiple selection.. I'd love to just ctrl+double-click a few variables in my code and start typing to rename them all.

I looked into the code a bit and found that simply commenting out the call to SetEmptySelection() in Editor::ButtonDown() seems to have the result I'm looking for. Though, I'm not sure if that causes any side-effects.

The line I removed was Editor.cxx:5624 in the Scintilla 2.02 release. It would be Editor.cxx:5640 in mainline CVS (Editor.cxx file revision 1.505).


  • Neil Hodgson

    Neil Hodgson - 2010-02-07
    • milestone: --> Feature_Request
    • priority: 5 --> 3
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-accepted
  • Neil Hodgson

    Neil Hodgson - 2010-02-07

    The details of selection are now quite complex. This change has at least one problem. One of the rules of Scintilla's multiple selection is that no character can be selected twice since this becomes very complex - it was allowed in an early version. If the current selection isn't cleared for Ctrl+DoubleClick then it goes into word-extend mode (drag the mouse and additional words are selected). This does not perform the tentative selection trim operations that are done if you Ctrl+SingleClick and then move the mouse into an existing selection. There may also be complications where the existing selection is rectangular.

    You could look into duplicating some of the tentative selection logic into the word (and line) selection branches in ButtonMove and ButtonUp but be warned this may require quite some time as additional issues are discovered.

  • Neil Hodgson

    Neil Hodgson - 2016-02-23
    • status: open-accepted --> open-fixed
  • Neil Hodgson

    Neil Hodgson - 2016-02-23

    Ctrl+Double click adding words implemented with [c09774].



    Commit: [c09774]

  • Neil Hodgson

    Neil Hodgson - 2016-03-16
    • status: open-fixed --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks