micro icon indicating copy to clipboard operation
micro copied to clipboard

Zig syntax highlighting for operators breaks after strings

Open Andriamanitra opened this issue 2 years ago • 0 comments

To reproduce open a file z.zig and paste this code in:

const std = @import("std");

pub fn main() void {
    var num: i32 = 42 + 24; // this + gets colored as it should
    std.debug.print("num = {d}\n", .{num + 3}); // this + doesn't
}

This is another issue caused by the weird behavior of highlighter when there are ^ or $ characters inside regular expressions (here it is used inside a character group so it should mean literal ^, but highlighter still tries to find a beginning of a line): https://github.com/zyedidia/micro/blob/03ae049c0fe5862ca6010474dd775656bd6e5b86/runtime/syntax/zig.yaml#L17

Commit hash: 03ae049c

Andriamanitra avatar Jun 18 '22 03:06 Andriamanitra