ziglang / zig-mode

Zig mode for Emacs
GNU General Public License v3.0
163 stars 54 forks source link

Auto indentation fails on K&R style curly braces #16

Open BitPuffin opened 5 years ago

BitPuffin commented 5 years ago

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");
}
visceralchokehold commented 2 years ago

did you ever find a solution to this?

averycoolbean commented 1 year ago

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