diff options
Diffstat (limited to 'examples/live/src')
| -rw-r--r-- | examples/live/src/main.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/live/src/main.zig b/examples/live/src/main.zig index 14058de..6e0f7e3 100644 --- a/examples/live/src/main.zig +++ b/examples/live/src/main.zig @@ -371,6 +371,8 @@ fn sound(s: *const State, ss: *Session, f: *sk.Frame) void { } const scale = 1.25; +/// The name a line defines is this much larger than the rest. +const step = 1.2; const margin = 16; const ink = 0xe8e8e8; const red = 0xff5a50; @@ -394,7 +396,10 @@ fn paragraph(a: std.mem.Allocator, ed: *const Editor, text: []const u8) sk.text. for (classes, 0..) |class, i| { if (i > 0 and classes[i - 1] == class) continue; const c = pe.syntax.synInk(theme, class) orelse base; - spans[n] = .{ .start = @intCast(i), .color = .{ .r = c[0], .g = c[1], .b = c[2] } }; + // the name a line defines, a step larger: the class the grammar's + // highlights give a definition's name node, and it alone + // (queries/highlights.scm) + spans[n] = .{ .start = @intCast(i), .color = .{ .r = c[0], .g = c[1], .b = c[2] }, .scale = if (class == .keyword) scale * step else null }; n += 1; } p.spans = spans; |
