Commit 6e3d229
committed
Grammar: Fix var x = init(...) highlighting
This fixes change introduced in a8328ab that
was adding type highlighting in `var x Type`. However the rule (.*)\s*(?:=|$)
was greedy consuming everything until `=` or `$` (end of line). As a
consequence it was effectively matching everything till end of line, consuming
also `=` and everything that follows, resulting incorrect highlight, for eg.:
var addr = flag.String("addr", ":8080", "TCP address to listen to")
Now replacing RE to use lazy (non-greedy) (.*?)\s*(?:=|$) rule.1 parent 7cb7593 commit 6e3d229
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| |||
0 commit comments