mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: prevent possible trailing whitespace in wrapped infixes (#9573)
This commit is contained in:
@@ -204,7 +204,7 @@ fn color_highlight(code string, tb &ast.Table) string {
|
||||
if (tok.lit in builtin || tb.known_type(tok.lit))
|
||||
&& (next_tok.kind != .lpar || prev.kind !in [.key_fn, .rpar]) {
|
||||
tok_typ = .builtin
|
||||
} else if
|
||||
} else if
|
||||
next_tok.kind in [.lcbr, .rpar, .eof, .comma, .pipe, .name, .rcbr, .assign, .key_pub, .key_mut, .pipe, .comma]
|
||||
&& prev.kind in [.name, .amp, .rsbr, .key_type, .assign, .dot, .question, .rpar, .key_struct, .key_enum, .pipe, .key_interface]
|
||||
&& (tok.lit[0].ascii_str().is_upper() || prev_prev.lit in ['C', 'JS']) {
|
||||
|
||||
Reference in New Issue
Block a user