#1399 whole-line selection of collapsed header line is incorrect

Scintilla (796)

An example will illustrate. Given this code with LF EOLs, where the
offset of the first character of each line is given in the left "margin":

00: if (1) {
09: print 'hi';
25: }
27: print 'done';
41: <EOF>

Collapse the first line, and then click in the whole-line selection margin.
This selects characters 0 - 9 (0 - 8 inclusive). The problem is that if
the selected block is then dragged, only the first line is dragged, and
the rest of the collapsed block disappears. The first issue is unexpected
and disappointing, the second unacceptable.

The "whole-line" selection should cover the entire collapsed block;
it should end at position 27 (26 inclusive).

Patch coming up.


  • Eric Promislow

    Eric Promislow - 2012-08-30

    Better patch: always get next visible line for end of line-selection

  • Neil Hodgson

    Neil Hodgson - 2012-08-30

    I can not reproduce the disappearing text in SciTE.

    Selecting only the single line rather than the entire block was a conscious choice.

  • Marko Njezic

    Marko Njezic - 2012-08-31

    In addition to previous comment, I would also like to point out that the provided patch is completely bugged. The patch basically breaks line selection completely when word wrap is enabled (this also includes breaking triple-click).

    As far as line selection is concerned and judging by past experience, whether it should cover entire folded block or not is open for debate and any changes to it should not be taken lightly. However, there is nothing unexpected in current behavior.

    The priority of this bug report should also be lowered, since the most serious issue with disappearing text doesn't really exist in Scintilla and is actually a problem in your software.

  • Eric Promislow

    Eric Promislow - 2012-08-31
    • status: open --> closed-rejected
  • Eric Promislow

    Eric Promislow - 2012-08-31

    I'll leave this as a Komodo-issue only, and verify that the patch doesn't break in
    those other situations.

  • Neil Hodgson

    Neil Hodgson - 2012-08-31

    You should closely compare how SciTE does folding with your code. SciTE's folding code has been updated to fix bugs over time but some client code copied this once and haven't updated since. It would simplify clients and remove potential bugs if Scintilla were to provide standard implementations to respond to SCN_NEEDSHOWN, SCN_MODIFIED.SC_MOD_CHANGEFOLD and SCN_MARGINCLICK. That has been on my list of tasks for years but its low priority.

    Although most people have been satisfied with having the margin click select only a single line and not the whole fold structure, it may be OK to add a choice to allow selecting the folded area.

  • Neil Hodgson

    Neil Hodgson - 2012-08-31
    • priority: 7 --> 3

Log in to post a comment.