Menu

#250 Add "Do not indent inline var if in a new line"

open
nobody
5
2026-07-27
2026-07-27
No

The new option to force line break after inline var is great. I believe adding a related Indent option "Do not indent inline var if in a new line" would help too, specially because it will support formatting that was supported before the mentioned new feature.

Simple example:

// Unformatted example
var LExample1: IExample := TExample.Create;
var
LExample1: IExample := TExample.Create;

// After inline "var" = OFF
// Do not indent inline var in in a new line = OFF
var LExample1: IExample := TExample.Create;
var
    LExample1: IExample := TExample.Create;

// After inline "var" = ON
// Do not indent inline var in in a new line = OFF
var 
    LExample1: IExample := TExample.Create;
var
    LExample1: IExample := TExample.Create;

// After inline "var" = OFF
// Do not indent inline var in in a new line = ON
var LExample1: IExample := TExample.Create;
var
LExample1: IExample := TExample.Create;

// After inline "var" = ON
// Do not indent inline var in in a new line = ON
var 
LExample1: IExample := TExample.Create;
var
 LExample1: IExample := TExample.Create;

Discussion

  • Thomas Mueller

    Thomas Mueller - 2026-07-27

    Sorry, now I am confused. I don't see the change you would like to have.
    Did you declare the same variable twice on purpose?

     
  • Luka Havrlišan

    Luka Havrlišan - 2026-07-27

    My bad, I might've overcomplicated. Yes, I declared it on purpose to differentiate between writing the inline var in one line vs in two lines. To simplify, the change I'd like is a new option "Do not indent inline var in a new line" that when turned on, instead of getting this:

    var
        LExample1: IExample := TExample.Create;
    

    we get this:

    var
    LExample1: IExample := TExample.Create;
    
     

    Last edit: Luka Havrlišan 2026-07-27
    • Thomas Mueller

      Thomas Mueller - 2026-07-27

      Understood, thanks for clarifying

       

Log in to post a comment.