refactor: run zig fmt
This commit is contained in:
parent
3524f70db5
commit
351412231f
4 changed files with 8 additions and 8 deletions
|
@ -2,7 +2,7 @@ const std = @import("std");
|
||||||
const tp = @import("thespian");
|
const tp = @import("thespian");
|
||||||
const log = @import("log");
|
const log = @import("log");
|
||||||
|
|
||||||
pub var context_check: ?*const fn() void = null;
|
pub var context_check: ?*const fn () void = null;
|
||||||
|
|
||||||
pub const ID = usize;
|
pub const ID = usize;
|
||||||
pub const ID_unknown = std.math.maxInt(ID);
|
pub const ID_unknown = std.math.maxInt(ID);
|
||||||
|
@ -98,7 +98,7 @@ pub fn removeCommand(id: ID) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn execute(id: ID, ctx: Context) tp.result {
|
pub fn execute(id: ID, ctx: Context) tp.result {
|
||||||
if(context_check) |check| check();
|
if (context_check) |check| check();
|
||||||
if (id >= commands.items.len)
|
if (id >= commands.items.len)
|
||||||
return tp.exit_fmt("CommandNotFound: {d}", .{id});
|
return tp.exit_fmt("CommandNotFound: {d}", .{id});
|
||||||
const cmd = commands.items[id];
|
const cmd = commands.items[id];
|
||||||
|
|
|
@ -113,10 +113,10 @@ pub const gitcommit = .{
|
||||||
pub const gleam = .{
|
pub const gleam = .{
|
||||||
.color = 0xffaff3,
|
.color = 0xffaff3,
|
||||||
.icon = "",
|
.icon = "",
|
||||||
.extensions = .{ "gleam" },
|
.extensions = .{"gleam"},
|
||||||
.comment = "//",
|
.comment = "//",
|
||||||
.language_server = .{"gleam", "lsp"},
|
.language_server = .{ "gleam", "lsp" },
|
||||||
.formatter = .{"gleam", "format", "--stdin"},
|
.formatter = .{ "gleam", "format", "--stdin" },
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const go = .{
|
pub const go = .{
|
||||||
|
|
|
@ -349,11 +349,11 @@ test "get_from_pos" {
|
||||||
try std.testing.expectEqualDeep(result1[0..line0.len], line0);
|
try std.testing.expectEqualDeep(result1[0..line0.len], line0);
|
||||||
|
|
||||||
const result2 = buffer.root.get_from_pos(.{ .row = 1, .col = 5 }, &result_buf, metrics());
|
const result2 = buffer.root.get_from_pos(.{ .row = 1, .col = 5 }, &result_buf, metrics());
|
||||||
try std.testing.expectEqualDeep(result2[0..line1.len - 5], line1[5..]);
|
try std.testing.expectEqualDeep(result2[0 .. line1.len - 5], line1[5..]);
|
||||||
|
|
||||||
_, _, const root = try buffer.root.insert_chars(1, 3, " ", buffer.allocator, metrics());
|
_, _, const root = try buffer.root.insert_chars(1, 3, " ", buffer.allocator, metrics());
|
||||||
buffer.update(root);
|
buffer.update(root);
|
||||||
|
|
||||||
const result3 = buffer.root.get_from_pos(.{ .row = 1, .col = 5 }, &result_buf, metrics());
|
const result3 = buffer.root.get_from_pos(.{ .row = 1, .col = 5 }, &result_buf, metrics());
|
||||||
try std.testing.expectEqualDeep(result3[0..line1.len - 4], line1[4..]);
|
try std.testing.expectEqualDeep(result3[0 .. line1.len - 4], line1[4..]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue