Miko330 0 Posted November 24, 2023 (edited) try var a := 2; test(a); finally end; becomes : try var a:=2; test(a); finally end; I don't know if this is the right method: after adding 2 lines in 'GX_CodeFormatterFormatter.pas' at line 1633 ------------------------------------------------------------------------- end else if (FPrevToken.GetExpression(exp) and SameText(exp, 'for')) then begin // for with inline var declaration end else if (fStack.GetTopType = rtTry) then begin // inline var declaration inside Try/finally block end else begin --------------------------------------------------------------------------- everything becomes good with the right indentation inside Try/Finally. Edited November 24, 2023 by Miko330 Share this post Link to post
baka0815 12 Posted November 24, 2023 Does this also apply to inline variables inside begin/end blocks or only to try..except/finally blocks? Share this post Link to post
dummzeuch 1505 Posted November 24, 2023 1 hour ago, Miko330 said: try var a := 2; test(a); finally end; becomes : try var a:=2; test(a); finally end; I don't know if this is the right method: after adding 2 lines in 'GX_CodeFormatterFormatter.pas' at line 1633 ------------------------------------------------------------------------- end else if (FPrevToken.GetExpression(exp) and SameText(exp, 'for')) then begin // for with inline var declaration end else if (fStack.GetTopType = rtTry) then begin // inline var declaration inside Try/finally block end else begin --------------------------------------------------------------------------- everything becomes good with the right indentation inside Try/Finally. Just to confirm: Your first example is how you think it should be formatted? Share this post Link to post
Miko330 0 Posted November 24, 2023 The inline var line is not indented. what i want : try var a := 2; test(a); finally end; and the formatter gives me this : try var a:=2; test(a); finally end; Share this post Link to post
Miko330 0 Posted November 24, 2023 @baka0815 as before + try/finally/except block Share this post Link to post
dummzeuch 1505 Posted November 26, 2023 (edited) fixed: https://sourceforge.net/p/gexperts/bugs/336/ Thanks for the report and the patch. Edited November 26, 2023 by dummzeuch Share this post Link to post
dummzeuch 1505 Posted November 26, 2023 On 11/24/2023 at 1:02 PM, baka0815 said: Does this also apply to inline variables inside begin/end blocks or only to try..except/finally blocks? Inline variable declarations in begin end blocks already worked fine. Share this post Link to post