Skip to content

Commit

Permalink
fmt: remove additional line breaks after call_expr before params stru…
Browse files Browse the repository at this point in the history
…ct args (#19795)
  • Loading branch information
ttytm committed Nov 7, 2023
1 parent cd5c556 commit 22e17c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vlib/v/fmt/fmt.v
Expand Up @@ -1976,11 +1976,12 @@ fn (mut f Fmt) write_generic_call_if_require(node ast.CallExpr) {
}

pub fn (mut f Fmt) call_args(args []ast.CallArg) {
f.single_line_fields = true
old_single_line_fields_state := f.single_line_fields
old_short_arg_state := f.use_short_fn_args
f.single_line_fields = true
f.use_short_fn_args = false
defer {
f.single_line_fields = false
f.single_line_fields = old_single_line_fields_state
f.use_short_fn_args = old_short_arg_state
}
for i, arg in args {
Expand Down
@@ -0,0 +1,10 @@
[params]
struct Bar {
bar bool
}

fn foo(msg string, opts Bar) {
println(msg)
}

foo(123.str(), bar: true)

0 comments on commit 22e17c3

Please sign in to comment.