SynEdit: (Un)Indent current line, if no selection - fix if caret at BOL. Issue #0019724

git-svn-id: trunk@32139 -
This commit is contained in:
martin 2011-09-01 00:26:21 +00:00
parent 32102f58e7
commit 55f3a736d6

View File

@ -98,6 +98,7 @@ const
// SynDefaultFont is determined in InitSynDefaultFont()
SynDefaultFontName: String = '';
SynDefaultFontHeight: Integer = 13;
SynDefaultFontSize: Integer = 10;
SynDefaultFontPitch: TFontPitch = fpFixed;
SynDefaultFontQuality: TFontQuality = fqNonAntialiased;
@ -7809,14 +7810,14 @@ begin
if not SelAvail then begin
BB := CaretXY;
BE := CaretXY;
e := BE.y;
end else begin
BB := BlockBegin;
BE := BlockEnd;
if (BE.X = 1)
then e := BE.y - 1
else e := BE.y;
end;
if (BE.X = 1) then
e := BE.y - 1
else
e := BE.y;
Spaces := StringOfChar(#32, fBlockIndent);
fUndoList.Lock;
@ -7870,15 +7871,16 @@ begin
if not SelAvail then begin
BB := CaretXY;
BE := CaretXY;
e := BE.y;
end else begin
BB := BlockBegin;
BE := BlockEnd;
// convert selection to complete lines
if BE.X = 1 then
e := BE.y - 1
else
e := BE.y;
end;
// convert selection to complete lines
if BE.X = 1 then
e := BE.y - 1
else
e := BE.y;
IncPaintLock;
FBlockSelection.IncPersistentLock;