Skip to content

Commit 22e17c3

Browse files
authored
fmt: remove additional line breaks after call_expr before params struct args (#19795)
1 parent cd5c556 commit 22e17c3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

vlib/v/fmt/fmt.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,11 +1976,12 @@ fn (mut f Fmt) write_generic_call_if_require(node ast.CallExpr) {
19761976
}
19771977

19781978
pub fn (mut f Fmt) call_args(args []ast.CallArg) {
1979-
f.single_line_fields = true
1979+
old_single_line_fields_state := f.single_line_fields
19801980
old_short_arg_state := f.use_short_fn_args
1981+
f.single_line_fields = true
19811982
f.use_short_fn_args = false
19821983
defer {
1983-
f.single_line_fields = false
1984+
f.single_line_fields = old_single_line_fields_state
19841985
f.use_short_fn_args = old_short_arg_state
19851986
}
19861987
for i, arg in args {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[params]
2+
struct Bar {
3+
bar bool
4+
}
5+
6+
fn foo(msg string, opts Bar) {
7+
println(msg)
8+
}
9+
10+
foo(123.str(), bar: true)

0 commit comments

Comments
 (0)