View Issue Details

IDProjectCategoryView StatusLast Update
0034760LazarusPackagespublic2019-01-03 19:12
ReporterAlexey Tor.Assigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWin10 x32OSOS Version
Product Version2.1 (SVN)Product Build 
Target Version2.2Fixed in Version2.2 
Summary0034760: SynEdit: Selection via Gutter (or any smLine mode) skips folded lines, if fold header line gets selected
Descriptioni have function

    procedure TTestComp.DoHandleClick;
    var
      Action: TATTabActionOnClose;
      R: TRect;
    begin
      if FMouseDownButton=mbMiddle then
      ...
      

- I fold block with vars by clicking + on gutter
- i click on gutter, line index, near folded block (note: dont drag mouse down, ONLY click)
- i see that all folded block is selected
- i press Del

expected: all folded block is deleted until begin of function.
reality: only part of folded text is deleted.
TagsNo tags attached.
Fixed in Revision59971
LazTarget2.2
WidgetsetWin32/Win64
Attached Files

Activities

Alexey Tor.

2018-12-31 11:06

reporter   ~0113037

Martin,
do you consider it as an issue, want to fix it?

Martin Friebe

2018-12-31 12:43

manager   ~0113040

Yes. That is why it is assigned.

Martin Friebe

2019-01-02 15:57

manager   ~0113102

Edited summary. This is a functional issue, not a visual glitch

Martin Friebe

2019-01-02 16:20

manager   ~0113104

The issue applies to all selection in mode smLine.

If the entire "fold start" line gets selected, then the folded lines should be selected too (they are to be considered part of that line)

However the correct behaviour is more complex. If the "fold start" line was selected before the lines got folded, then the extend of the selection should not change.
Consider this:
  inc(a);
  if a > 9 then
  begin
    Foo();
    Bar();
  end;
  dec(a);

Select (Gutter or smLine) the line "Foo" to "if" (backward). Then Fold at "begin". The fold action does not extend the selection to include "Bar" and "end".
Even if you extend the selection (Shift Gutter on "inc"), that will not extend the selection.

The entire folded block will only be selected, if the "fold start" line gets newly selected (i.e. was not previously already selected).

------
If "Bar" is smLine selected, then the block gets folded, and next the selection is extended to "dec", there is on indicator that part of the folded block is selected. (That only works with persistent block, if at all / not tested).

Alternative: If (backward) "Bar" to "inc" is selected, fold is applied, and then selection is changed by shift gutter on "dec". The result is "bar" to "dec" selected. No indication on the "fold start" line.

This is currently the designed behaviour. The "fold start" line is not selected, so there is no place to indicate the selection part hidden inside the fold.

It might/could later be added, by modifying the [...] symbol.

-------
Please test with revision 59971
and close if ok

Martin Friebe

2019-01-03 19:12

manager   ~0113134

Test with r59983 - Should only apply to user input.

Selections set from user-code should not have "smart" behaviour by default.

Issue History

Date Modified Username Field Change
2018-12-25 12:03 Alexey Tor. New Issue
2018-12-25 13:06 Martin Friebe Assigned To => Martin Friebe
2018-12-25 13:06 Martin Friebe Status new => assigned
2018-12-31 11:06 Alexey Tor. Note Added: 0113037
2018-12-31 12:43 Martin Friebe Note Added: 0113040
2019-01-02 15:57 Martin Friebe LazTarget => -
2019-01-02 15:57 Martin Friebe Note Added: 0113102
2019-01-02 15:57 Martin Friebe Summary Visual glitch in SynEdit in IDE => SynEdit: Selection via Gutter (or any smLine mode) skips folded lines, if fold header line gets selected
2019-01-02 16:20 Martin Friebe Note Added: 0113104
2019-01-02 16:20 Martin Friebe Status assigned => resolved
2019-01-02 16:20 Martin Friebe Resolution open => fixed
2019-01-02 16:21 Martin Friebe Fixed in Revision => 59971
2019-01-02 16:21 Martin Friebe LazTarget - => 2.2
2019-01-02 16:21 Martin Friebe Fixed in Version => 2.2
2019-01-02 16:21 Martin Friebe Target Version => 2.2
2019-01-03 19:12 Martin Friebe Note Added: 0113134