prevent to systematically lex on new line

This commit is contained in:
Basile Burg 2017-04-29 10:02:41 +02:00
parent 8972a689a7
commit 4adccd5275
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 10 additions and 2 deletions

View File

@ -2545,6 +2545,7 @@ procedure TCESynMemo.KeyDown(var Key: Word; Shift: TShiftState);
var
line: string;
ddc: char;
lxd: boolean;
begin
case Key of
VK_BACK: if fCallTipWin.Visible and (CaretX > 1)
@ -2571,11 +2572,13 @@ begin
if (fAutoCloseCurlyBrace = autoCloseOnNewLineLexically) or
fSmartDdocNewline then
begin
fLexToks.Clear;
lex(lines.Text, fLexToks);
lxd := false;
if (LogicalCaretXY.X - 1 >= line.length)
or isBlank(line[LogicalCaretXY.X .. line.length]) then
begin
lxd := true;
fLexToks.Clear;
lex(lines.Text, fLexToks);
if lexCanCloseBrace then
begin
Key := 0;
@ -2584,6 +2587,11 @@ begin
end;
if (fSmartDdocNewline) then
begin
if not lxd then
begin
fLexToks.Clear;
lex(lines.Text, fLexToks);
end;
ddc := lexInDdoc;
if ddc in ['*', '+'] then
begin