SynEdit: Fixed Toggle comment

git-svn-id: trunk@20977 -
This commit is contained in:
martin 2009-07-27 16:17:43 +00:00
parent cd7b675c96
commit e6aaa72fe6

View File

@ -2010,10 +2010,7 @@ begin
if CommentOn then begin
for i := BlockEndLine downto BlockBeginLine do
begin
FEditor.BlockBegin := Point(InsertPos(i), i);
FEditor.SelText := '//';
end;
FEditor.TextBetweenPoints[Point(InsertPos(i), i), Point(InsertPos(i), i)] := '//';
if OldCaretPos.X > InsertPos(OldCaretPos.Y) then
OldCaretPos.x := OldCaretPos.X + 2;
if OldBlockStart.X > InsertPos(OldBlockStart.Y) then
@ -2026,9 +2023,7 @@ begin
begin
NonBlankStart := DeletePos(i);
if NonBlankStart < 1 then continue;
FEditor.BlockBegin := Point(NonBlankStart, i);
FEditor.BlockEnd := Point(NonBlankStart + 2, i);
FEditor.SelText := '';
FEditor.TextBetweenPoints[Point(NonBlankStart, i), Point(NonBlankStart + 2, i)] := '';
if (OldCaretPos.Y = i) and (OldCaretPos.X > NonBlankStart) then
OldCaretPos.x := Max(OldCaretPos.X - 2, NonBlankStart);
if (OldBlockStart.Y = i) and (OldBlockStart.X > NonBlankStart) then