fmt: AnonFn with body is not single line (#7659)
parent
2360762a42
commit
cf441091f1
|
@ -1723,6 +1723,11 @@ fn stmt_is_single_line(stmt ast.Stmt) bool {
|
|||
|
||||
fn expr_is_single_line(expr ast.Expr) bool {
|
||||
match expr {
|
||||
ast.AnonFn {
|
||||
if !expr.decl.no_body {
|
||||
return false
|
||||
}
|
||||
}
|
||||
ast.IfExpr {
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -35,6 +35,12 @@ fn main() {
|
|||
f: 'here'
|
||||
}
|
||||
)
|
||||
ui.button(
|
||||
width: 70
|
||||
onclick: fn (a voidptr, b voidptr) {
|
||||
webview.new_window(url: 'https://vlang.io', title: 'The V programming language')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fn bar_func(bar Bar) {
|
||||
|
|
Loading…
Reference in New Issue