SynEdit: ecPluginMultiCaretToggleCaret doesn't remove the first MultiCaret
Original Reporter info from Mantis: PascalR @PascalRiekenberg
-
Reporter name: Pascal Riekenberg
Original Reporter info from Mantis: PascalR @PascalRiekenberg
- Reporter name: Pascal Riekenberg
Description:
The editor command ecPluginMultiCaretToggleCaret doesn't remove the first MultiCaret
Steps to reproduce:
Create multiple MultiCarets by keystroke (default: SHIFT+CTRL+SPACE but not set in the IDE) and try to remove the first created one.
Additional information:
change "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;
...
Mantis conversion info:
- Mantis ID: 29456
- OS: Windows
- OS Build: 7+
- Build: trunc
- Platform: i386
- Fixed in version: 1.10
- Fixed in revision: 58189 (#dc1a9b3f)
- Target version: 1.10