SynEdit, beautifier: fixed in indent, in cases where newline was inserted at pos 1

git-svn-id: trunk@20700 -
This commit is contained in:
martin 2009-06-22 01:43:25 +00:00
parent 690665dd68
commit 063dd74efc

View File

@ -248,11 +248,18 @@ begin
else
y := ACaret.LinePos + 1;
Indent := GetIntend(y, b);
s := GetCharMix(y, Indent, '', b);
if (FIndentType = sbitPositionCaret) and (FCurrentLines[y] = '') then
s := '';
FCurrentLines.EditInsert(1, y, s);
if (Command = ecLineBreak) and
(FCurrentLines[y-2] = '') and (FCurrentLines[y-1] <> '')
then
Indent := 0
else
Indent := GetIntend(y, b);
if Indent > 0 then begin
s := GetCharMix(y, Indent, '', b);
if (FIndentType = sbitPositionCaret) and (FCurrentLines[y-1] = '') then
s := '';
FCurrentLines.EditInsert(1, y, s);
end;
if (Command = ecLineBreak) then begin
ACaret.IncForcePastEOL;