mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-06 07:06:01 +02:00
SynEdit: Fixed Toggle comment
git-svn-id: trunk@20977 -
This commit is contained in:
parent
cd7b675c96
commit
e6aaa72fe6
@ -2010,10 +2010,7 @@ begin
|
|||||||
|
|
||||||
if CommentOn then begin
|
if CommentOn then begin
|
||||||
for i := BlockEndLine downto BlockBeginLine do
|
for i := BlockEndLine downto BlockBeginLine do
|
||||||
begin
|
FEditor.TextBetweenPoints[Point(InsertPos(i), i), Point(InsertPos(i), i)] := '//';
|
||||||
FEditor.BlockBegin := Point(InsertPos(i), i);
|
|
||||||
FEditor.SelText := '//';
|
|
||||||
end;
|
|
||||||
if OldCaretPos.X > InsertPos(OldCaretPos.Y) then
|
if OldCaretPos.X > InsertPos(OldCaretPos.Y) then
|
||||||
OldCaretPos.x := OldCaretPos.X + 2;
|
OldCaretPos.x := OldCaretPos.X + 2;
|
||||||
if OldBlockStart.X > InsertPos(OldBlockStart.Y) then
|
if OldBlockStart.X > InsertPos(OldBlockStart.Y) then
|
||||||
@ -2026,9 +2023,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
NonBlankStart := DeletePos(i);
|
NonBlankStart := DeletePos(i);
|
||||||
if NonBlankStart < 1 then continue;
|
if NonBlankStart < 1 then continue;
|
||||||
FEditor.BlockBegin := Point(NonBlankStart, i);
|
FEditor.TextBetweenPoints[Point(NonBlankStart, i), Point(NonBlankStart + 2, i)] := '';
|
||||||
FEditor.BlockEnd := Point(NonBlankStart + 2, i);
|
|
||||||
FEditor.SelText := '';
|
|
||||||
if (OldCaretPos.Y = i) and (OldCaretPos.X > NonBlankStart) then
|
if (OldCaretPos.Y = i) and (OldCaretPos.X > NonBlankStart) then
|
||||||
OldCaretPos.x := Max(OldCaretPos.X - 2, NonBlankStart);
|
OldCaretPos.x := Max(OldCaretPos.X - 2, NonBlankStart);
|
||||||
if (OldBlockStart.Y = i) and (OldBlockStart.X > NonBlankStart) then
|
if (OldBlockStart.Y = i) and (OldBlockStart.X > NonBlankStart) then
|
||||||
|
Loading…
Reference in New Issue
Block a user