zig-mode icon indicating copy to clipboard operation
zig-mode copied to clipboard

Auto indentation fails on K&R style curly braces

Open BitPuffin opened this issue 5 years ago • 2 comments

When trying to write:

const std = @import("std");
pub fn main() void
{
    std.debug.warn("hello");
}

The auto indenter turns it into:

const std = @import("std");
pub fn main() void
    {
        std.debug.warn("hello");
}

BitPuffin avatar Jun 17 '19 09:06 BitPuffin

did you ever find a solution to this?

visceralchokehold avatar May 31 '22 18:05 visceralchokehold

similarly to go, zig and most things surrounding it sadly don't really support much outside of the de-facto zig style, which puts the opening brackets on the same line as the function definition

though i would also prefer to just be able to use allman/bsd style indentation, in this case id recommend just installing the highlight-indent-guides mode, it helps the readability a decent amount without conflicting with the typical style

averycoolbean avatar Sep 11 '22 20:09 averycoolbean