ziglang / zig.vim

Vim configuration for Zig
MIT License
448 stars 56 forks source link

missing indent for multi-line global statement #86

Open talcynon opened 1 year ago

talcynon commented 1 year ago

At a global level, writing const x = followed by a new line does not add indentation. (== doesn't affect the code.) Indentation is added correctly when the code is in a function.

Expected:

// Should indent...
const a =
    123;

pub fn main() u8 {
    // Indents as expected.
    const b =
        0;
    return b;
}

Actual:

// Should indent...
const a =
123;

pub fn main() u8 {
    // Indents as expected.
    const b =
        0;
    return b;
}