feat: update to latest flow-syntax for julia and swift support
This commit is contained in:
parent
283bfa5407
commit
fc512c0689
2 changed files with 10 additions and 10 deletions
|
@ -7,12 +7,12 @@
|
||||||
.hash = "12207ee987ce045596cb992cfb15b0d6d9456e50d4721c3061c69dabc2962053644d",
|
.hash = "12207ee987ce045596cb992cfb15b0d6d9456e50d4721c3061c69dabc2962053644d",
|
||||||
},
|
},
|
||||||
.themes = .{
|
.themes = .{
|
||||||
.url = "https://github.com/neurocyte/flow-themes/releases/download/master-08c07e21c47abe41ebd16ee260438da5b4c2039e/flow-themes.tar.gz",
|
.url = "https://github.com/neurocyte/flow-themes/releases/download/master-5f1ca2fd3c784d430306a5cd1df237681a196333/flow-themes.tar.gz",
|
||||||
.hash = "12202be270e675e3b61d96845baad143494539b167bcb8b1ef32659bf146dd85d3e1",
|
.hash = "122095b1a6110b920571c7e49e61c124cd9a164fe9b1b0faa1bd11d04d89822d3304",
|
||||||
},
|
},
|
||||||
.syntax = .{
|
.syntax = .{
|
||||||
.url = "https://github.com/neurocyte/flow-syntax/archive/dcfa5cdf3f1f48411dc3c7ab8be26b7561673850.tar.gz",
|
.url = "https://github.com/neurocyte/flow-syntax/archive/3673787e55d4ac7df519d3918a7f9dc8ae4cf1a0.tar.gz",
|
||||||
.hash = "1220ea88bb77cba3cf85caeb8002823218503c601f9907ccffbd41329c632596ebc3",
|
.hash = "122092ac558d4b62e0850156899146f4335f8aefe082fc03dd62fd0660fac06e9a27",
|
||||||
},
|
},
|
||||||
.thespian = .{
|
.thespian = .{
|
||||||
.url = "https://github.com/neurocyte/thespian/archive/d7dd27116398b17c8ab68327c384885f161d0cc1.tar.gz",
|
.url = "https://github.com/neurocyte/thespian/archive/d7dd27116398b17c8ab68327c384885f161d0cc1.tar.gz",
|
||||||
|
|
12
src/main.zig
12
src/main.zig
|
@ -392,8 +392,8 @@ fn list_themes(writer: Writer) !void {
|
||||||
|
|
||||||
fn set_ansi_style(writer: Writer, style: Theme.Style) Writer.Error!void {
|
fn set_ansi_style(writer: Writer, style: Theme.Style) Writer.Error!void {
|
||||||
const ansi_style = .{
|
const ansi_style = .{
|
||||||
.foreground = if (style.fg) |color| to_rgb_color(color) else .Default,
|
.foreground = if (style.fg) |color| to_rgb_color(color.color) else .Default,
|
||||||
.background = if (style.bg) |color| to_rgb_color(color) else .Default,
|
.background = if (style.bg) |color| to_rgb_color(color.color) else .Default,
|
||||||
.font_style = switch (style.fs orelse .normal) {
|
.font_style = switch (style.fs orelse .normal) {
|
||||||
.normal => term.style.FontStyle{},
|
.normal => term.style.FontStyle{},
|
||||||
.bold => term.style.FontStyle.bold,
|
.bold => term.style.FontStyle.bold,
|
||||||
|
@ -409,8 +409,8 @@ fn set_ansi_style(writer: Writer, style: Theme.Style) Writer.Error!void {
|
||||||
const unset_ansi_style = set_ansi_style;
|
const unset_ansi_style = set_ansi_style;
|
||||||
|
|
||||||
fn write_html_preamble(writer: Writer, style: Theme.Style) !void {
|
fn write_html_preamble(writer: Writer, style: Theme.Style) !void {
|
||||||
const color = if (style.fg) |color| color else 0;
|
const color = if (style.fg) |color| color.color else 0;
|
||||||
const background = if (style.bg) |background| background else 0xFFFFFF;
|
const background = if (style.bg) |background| background.color else 0xFFFFFF;
|
||||||
try writer.writeAll("<div style=\"color:");
|
try writer.writeAll("<div style=\"color:");
|
||||||
try write_hex_color(writer, color);
|
try write_hex_color(writer, color);
|
||||||
try writer.writeAll(";background-color:");
|
try writer.writeAll(";background-color:");
|
||||||
|
@ -423,7 +423,7 @@ fn write_html_postamble(writer: Writer) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_html_style(writer: Writer, style: Theme.Style) !void {
|
fn set_html_style(writer: Writer, style: Theme.Style) !void {
|
||||||
const color = if (style.fg) |color| color else 0;
|
const color = if (style.fg) |color| color.color else 0;
|
||||||
try writer.writeAll("<span style=\"color:");
|
try writer.writeAll("<span style=\"color:");
|
||||||
try write_hex_color(writer, color);
|
try write_hex_color(writer, color);
|
||||||
switch (style.fs orelse .normal) {
|
switch (style.fs orelse .normal) {
|
||||||
|
@ -466,7 +466,7 @@ fn render_file_type(writer: Writer, file_type: *const syntax.FileType, theme: *c
|
||||||
try set_ansi_style(writer, reversed);
|
try set_ansi_style(writer, reversed);
|
||||||
try writer.writeAll("");
|
try writer.writeAll("");
|
||||||
try set_ansi_style(writer, .{
|
try set_ansi_style(writer, .{
|
||||||
.fg = if (file_type.color == 0xFFFFFF or file_type.color == 0x000000) style.fg else file_type.color,
|
.fg = if (file_type.color == 0xFFFFFF or file_type.color == 0x000000) style.fg else .{ .color = file_type.color },
|
||||||
.bg = style.bg,
|
.bg = style.bg,
|
||||||
});
|
});
|
||||||
try writer.writeAll(file_type.icon);
|
try writer.writeAll(file_type.icon);
|
||||||
|
|
Loading…
Add table
Reference in a new issue