fix: don't skip syntax highlighting the first symbol in a file

This commit is contained in:
CJ van den Berg 2024-11-06 16:38:58 +01:00
parent 9375ffabc0
commit 4360390b89
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1079,7 +1079,7 @@ pub const Editor = struct {
cache: *StyleCache,
root: Buffer.Root,
pos_cache: PosToWidthCache,
last_begin: Cursor = .{},
last_begin: Cursor = Cursor.invalid(),
fn cb(ctx: *@This(), range: syntax.Range, scope: []const u8, id: u32, idx: usize, _: *const syntax.Node) error{Stop}!void {
const sel_ = ctx.pos_cache.range_to_selection(range, ctx.root, ctx.self.metrics) orelse return;