mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:59:12 +02:00
SynEdit, beautifier: fixed in indent, in cases where newline was inserted at pos 1
git-svn-id: trunk@20700 -
This commit is contained in:
parent
690665dd68
commit
063dd74efc
@ -248,11 +248,18 @@ begin
|
|||||||
else
|
else
|
||||||
y := ACaret.LinePos + 1;
|
y := ACaret.LinePos + 1;
|
||||||
|
|
||||||
|
if (Command = ecLineBreak) and
|
||||||
|
(FCurrentLines[y-2] = '') and (FCurrentLines[y-1] <> '')
|
||||||
|
then
|
||||||
|
Indent := 0
|
||||||
|
else
|
||||||
Indent := GetIntend(y, b);
|
Indent := GetIntend(y, b);
|
||||||
|
if Indent > 0 then begin
|
||||||
s := GetCharMix(y, Indent, '', b);
|
s := GetCharMix(y, Indent, '', b);
|
||||||
if (FIndentType = sbitPositionCaret) and (FCurrentLines[y] = '') then
|
if (FIndentType = sbitPositionCaret) and (FCurrentLines[y-1] = '') then
|
||||||
s := '';
|
s := '';
|
||||||
FCurrentLines.EditInsert(1, y, s);
|
FCurrentLines.EditInsert(1, y, s);
|
||||||
|
end;
|
||||||
|
|
||||||
if (Command = ecLineBreak) then begin
|
if (Command = ecLineBreak) then begin
|
||||||
ACaret.IncForcePastEOL;
|
ACaret.IncForcePastEOL;
|
||||||
|
Loading…
Reference in New Issue
Block a user