mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 02:59:33 +02:00
Jedi Code Format: Indent try..finally..except blocks better. Issue #39989, patch by Domingo Galmés.
This commit is contained in:
parent
0ac5d3a4ce
commit
2d95dc76d7
@ -115,14 +115,26 @@ begin
|
||||
lcNode := TParseTreeNode(pcNode);
|
||||
|
||||
case lcNode.NodeType of
|
||||
nBlock, nCaseStatement,
|
||||
nIfBlock, nTryBlock, nFinallyBlock, nExceptBlock,
|
||||
nRepeatStatement, nWhileStatement, nForStatement,
|
||||
nWithStatement, nOnExceptionHandler, nInitSection:
|
||||
nBlock, nCaseStatement, nIfBlock, nRepeatStatement, nWhileStatement,
|
||||
nForStatement, nWithStatement, nOnExceptionHandler, nInitSection:
|
||||
begin
|
||||
leNestType := nlBlock;
|
||||
lbHasNesting := True;
|
||||
end;
|
||||
nTryBlock, nFinallyBlock, nExceptBlock:
|
||||
begin
|
||||
//if a=b then
|
||||
//try
|
||||
// writeln();
|
||||
//finally
|
||||
//end;
|
||||
// only indent try block if it is in begin end block.
|
||||
if lcNode.HasParentNode(nCompoundStatement,4) then
|
||||
begin
|
||||
leNestType := nlBlock;
|
||||
lbHasNesting := True;
|
||||
end;
|
||||
end;
|
||||
nElseBlock:
|
||||
begin
|
||||
{ if the else is immediately followed by if then it is not a block indent }
|
||||
|
Loading…
Reference in New Issue
Block a user