View Issue Details

IDProjectCategoryView StatusLast Update
0029456LazarusPackagespublic2018-06-09 06:13
ReporterPascal Riekenberg Assigned ToMartin Friebe  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 
Target Version1.10Fixed in Version1.10 
Summary0029456: SynEdit: ecPluginMultiCaretToggleCaret doesn't remove the first MultiCaret
DescriptionThe editor command ecPluginMultiCaretToggleCaret doesn't remove the first MultiCaret
Steps To ReproduceCreate multiple MultiCarets by keystroke (default: SHIFT+CTRL+SPACE but not set in the IDE) and try to remove the first created one.
Additional Informationchange "if (i > 0) ..." to "if (i >= 0) ...":

unit SynPluginMultiCaret;
...
TSynCustomPluginMultiCaret.ProcessMySynCommand:
...
    ecPluginMultiCaretToggleCaret: begin
        i := Carets.FindCaretIdx(CaretObj.BytePos, CaretObj.LinePos, CaretObj.BytePosOffset);
--> if (i > 0) or (sfCreateCaretAtCurrentPos in FStateFlags) then begin
          exclude(FStateFlags, sfCreateCaretAtCurrentPos);
          if i >= 0 then
            RemoveCaret(i);
        end
        else begin
          include(FStateFlags, sfCreateCaretAtCurrentPos);
        end;
        ActiveMode := mcmAddingCarets;
      end;
...


TagsNo tags attached.
Fixed in Revision58189
LazTarget1.10
Widgetset
Attached Files

Activities

Pascal Riekenberg

2016-12-19 22:28

developer  

synpluginmulticaret.pp.patch (630 bytes)   
Index: synpluginmulticaret.pp
===================================================================
--- synpluginmulticaret.pp	(revision 53724)
+++ synpluginmulticaret.pp	(working copy)
@@ -2322,7 +2322,7 @@
       end;
     ecPluginMultiCaretToggleCaret: begin
         i := Carets.FindCaretIdx(CaretObj.BytePos, CaretObj.LinePos, CaretObj.BytePosOffset);
-        if (i > 0) or (sfCreateCaretAtCurrentPos in FStateFlags) then begin
+        if (i >= 0) or (sfCreateCaretAtCurrentPos in FStateFlags) then begin
           exclude(FStateFlags, sfCreateCaretAtCurrentPos);
           if i >= 0 then
             RemoveCaret(i);

Pascal Riekenberg

2018-06-08 18:03

developer   ~0108760

While you are at it .... this is a simple one.

Martin Friebe

2018-06-08 21:47

manager   ~0108767

thanks

please test and close if ok

Pascal Riekenberg

2018-06-09 06:13

developer   ~0108774

Thanks!

Issue History

Date Modified Username Field Change
2016-01-20 23:25 Pascal Riekenberg New Issue
2016-01-20 23:39 Martin Friebe Assigned To => Martin Friebe
2016-01-20 23:39 Martin Friebe Status new => assigned
2016-12-19 22:28 Pascal Riekenberg File Added: synpluginmulticaret.pp.patch
2018-06-08 18:03 Pascal Riekenberg Note Added: 0108760
2018-06-08 21:47 Martin Friebe Fixed in Revision => 58189
2018-06-08 21:47 Martin Friebe LazTarget => 1.10
2018-06-08 21:47 Martin Friebe Note Added: 0108767
2018-06-08 21:47 Martin Friebe Status assigned => resolved
2018-06-08 21:47 Martin Friebe Fixed in Version => 1.10
2018-06-08 21:47 Martin Friebe Resolution open => fixed
2018-06-08 21:47 Martin Friebe Target Version => 1.10
2018-06-09 06:13 Pascal Riekenberg Note Added: 0108774
2018-06-09 06:13 Pascal Riekenberg Status resolved => closed