refactor: add binding set on_match_failure nothing mode

This commit is contained in:
CJ van den Berg 2026-02-24 23:16:23 +01:00
parent 6643341574
commit 3d81631679
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -485,7 +485,7 @@ const BindingSet = struct {
deinit_command: ?Command = null, deinit_command: ?Command = null,
const KeySyntax = enum { flow, vim }; const KeySyntax = enum { flow, vim };
const OnMatchFailure = enum { insert, ignore }; const OnMatchFailure = enum { insert, ignore, nothing };
fn load(allocator: std.mem.Allocator, namespace_name: []const u8, config_section: []const u8, mode_bindings: std.json.Value, fallback: ?*const BindingSet, namespace: *Namespace) (error{ OutOfMemory, WriteFailed } || parse_flow.ParseError || parse_vim.ParseError || std.json.ParseFromValueError)!@This() { fn load(allocator: std.mem.Allocator, namespace_name: []const u8, config_section: []const u8, mode_bindings: std.json.Value, fallback: ?*const BindingSet, namespace: *Namespace) (error{ OutOfMemory, WriteFailed } || parse_flow.ParseError || parse_vim.ParseError || std.json.ParseFromValueError)!@This() {
var self: @This() = .{ .name = undefined, .config_section = config_section, .selection_style = undefined }; var self: @This() = .{ .name = undefined, .config_section = config_section, .selection_style = undefined };
@ -787,6 +787,7 @@ const BindingSet = struct {
else else
log_keyhints_message(), log_keyhints_message(),
.ignore => log_keyhints_message(), .ignore => log_keyhints_message(),
.nothing => {},
} }
globals.current_sequence.clearRetainingCapacity(); globals.current_sequence.clearRetainingCapacity();
globals.current_sequence_egc.clearRetainingCapacity(); globals.current_sequence_egc.clearRetainingCapacity();