#1490 ClearSelections doesn't seem to work completely

Bug
closed-works-for-me
Neil Hodgson
5
2014-08-28
2013-06-20
Eric Promislow
No

At the end of a multi-caret session, I call ClearSelections in the following sequence:

    scimoz.multiPaste = scimoz.SC_MULTIPASTE_ONCE;
    scimoz.additionalSelectionTyping = false;
    scimoz.multipleSelection = false;
    scimoz.clearSelections();

When I start a new session and run the following code:

    scimoz.multipleSelection = true;
    scimoz.additionalSelectionTyping = true;
    scimoz.multiPaste = scimoz.SC_MULTIPASTE_EACH;

At this point, there are no additional selections. However, when
I'm ready to add the new selections, sometimes the first selection
from an earlier multi-selection session is active again. This might
have something to do with this line of code in Selection::Clear

ranges.push_back(SelectionRange())

I'll need to read more of the code to figure this out, but I wanted to throw
this out in case it's a bug.

Discussion

  • Neil Hodgson
    Neil Hodgson
    2013-06-21

    There has to always be a selection so there always has to be at least one element in ranges. The statement before was ranges.clear() so after that line there is exactly 1 element in ranges with the value (INVALID_POSITION+0,INVALID_POSITION+0). The second last line in Selection::Clear changes the range to (0+0,0+0).

    There could be an unexpected interaction with the TentativeSelection method and the rangesSaved field.

     
  • Neil Hodgson
    Neil Hodgson
    2013-07-21

    • status: open --> open-works-for-me
     
  • Neil Hodgson
    Neil Hodgson
    2013-10-15

    • labels: --> scintilla, selection
    • status: open-works-for-me --> closed-works-for-me
    • assigned_to: Neil Hodgson