Closed Dima-369 closed 2 months ago
Test with this (taken from my test to write bindings for https://github.com/sheredom/subprocess.h):
package subprocess import "core:c" import "core:c/libc" foreign import subprocess "libsubprocess.a" subprocess_s :: struct { stdin_file: ^libc.FILE, stdout_file: ^libc.FILE, stderr_file: ^libc.FILE, // assume that pid_t is an int child: c.uint, return_status: c.int, alive: c.size_t, } foreign subprocess { subprocess_create :: proc (command_line: [^]cstring, options: c.int, out_process: ^subprocess_s) -> c.int --- }
After reformat, it incorrectly looks like this:
foreign subprocess { subprocess_create :: proc (command_line: [^]cstring, options: c.int, out_process: ^subprocess_s) -> c.int --- }
I would expect the file to stay the same as the input, as usually all lines are indented inside a foreign block.
foreign
Found the bug
Fixed with ee57c98
Test with this (taken from my test to write bindings for https://github.com/sheredom/subprocess.h):
After reformat, it incorrectly looks like this:
I would expect the file to stay the same as the input, as usually all lines are indented inside a
foreign
block.