Compare commits

...

3 commits

3 changed files with 11 additions and 7 deletions

View file

@ -1,7 +1,7 @@
.{
.name = .flow,
.version = "0.2.0",
.minimum_zig_version = "0.14.1",
.version = "0.6.0",
.minimum_zig_version = "0.15.1",
.fingerprint = 0x52c0d670590aa80f,
.dependencies = .{

View file

@ -93,9 +93,11 @@ pub fn get(file_type_name: []const u8) !?@This() {
}
pub fn get_config_file_path(allocator: std.mem.Allocator, file_type: []const u8) ![]u8 {
var stream: std.Io.Writer.Allocating = .initOwnedSlice(allocator, try get_config_dir_path(allocator));
const config_dir_path = try get_config_dir_path(allocator);
var stream: std.Io.Writer.Allocating = .initOwnedSlice(allocator, config_dir_path);
defer stream.deinit();
const writer = &stream.writer;
writer.end = config_dir_path.len;
_ = try writer.writeAll(file_type);
_ = try writer.writeAll(".conf");
return stream.toOwnedSlice();

View file

@ -562,12 +562,14 @@ const BindingSet = struct {
for (self.press.items) |binding| {
const cmd = binding.commands[0].command;
var hint: std.Io.Writer.Allocating = if (hints_map.get(cmd)) |previous|
.initOwnedSlice(allocator, previous)
else
.init(allocator);
var end: usize = 0;
var hint: std.Io.Writer.Allocating = if (hints_map.get(cmd)) |previous| blk: {
end = previous.len;
break :blk .initOwnedSlice(allocator, previous);
} else .init(allocator);
defer hint.deinit();
const writer = &hint.writer;
writer.end = end;
if (hint.written().len > 0) try writer.writeAll(", ");
const count = binding.key_events.len;
for (binding.key_events, 0..) |key_, n| {