feat: make make "syntax": "flow" and "on_match_failure": "instert" optional in keybind config
This commit is contained in:
parent
a680f50771
commit
6d351080a8
2 changed files with 2 additions and 19 deletions
|
@ -219,8 +219,8 @@ const BindingSet = struct {
|
||||||
fn load_set_from_json(self: *BindingSet, mode_bindings: std.json.Value) (parse_flow.ParseError || parse_vim.ParseError || std.json.ParseFromValueError)!void {
|
fn load_set_from_json(self: *BindingSet, mode_bindings: std.json.Value) (parse_flow.ParseError || parse_vim.ParseError || std.json.ParseFromValueError)!void {
|
||||||
const JsonConfig = struct {
|
const JsonConfig = struct {
|
||||||
bindings: []const []const std.json.Value,
|
bindings: []const []const std.json.Value,
|
||||||
syntax: KeySyntax,
|
syntax: KeySyntax = .flow,
|
||||||
on_match_failure: OnMatchFailure,
|
on_match_failure: OnMatchFailure = .insert,
|
||||||
};
|
};
|
||||||
const parsed = try std.json.parseFromValue(JsonConfig, self.allocator, mode_bindings, .{
|
const parsed = try std.json.parseFromValue(JsonConfig, self.allocator, mode_bindings, .{
|
||||||
.ignore_unknown_fields = true,
|
.ignore_unknown_fields = true,
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
{
|
{
|
||||||
"flow": {
|
"flow": {
|
||||||
"normal": {
|
"normal": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+e", "open_recent"],
|
["ctrl+e", "open_recent"],
|
||||||
["ctrl+r", "open_recent_project"],
|
["ctrl+r", "open_recent_project"],
|
||||||
|
@ -145,7 +143,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "ignore",
|
"on_match_failure": "ignore",
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+f>ctrl+f>ctrl+f>ctrl+f>ctrl+f", "home_sheeran"],
|
["ctrl+f>ctrl+f>ctrl+f>ctrl+f>ctrl+f", "home_sheeran"],
|
||||||
|
@ -188,8 +185,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"palette": {
|
"palette": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+j", "toggle_panel"],
|
["ctrl+j", "toggle_panel"],
|
||||||
["ctrl+q", "quit"],
|
["ctrl+q", "quit"],
|
||||||
|
@ -238,8 +233,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mini/goto": {
|
"mini/goto": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+q", "quit"],
|
["ctrl+q", "quit"],
|
||||||
["ctrl+v", "system_paste"],
|
["ctrl+v", "system_paste"],
|
||||||
|
@ -255,8 +248,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mini/move_to_char": {
|
"mini/move_to_char": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+g", "mini_mode_cancel"],
|
["ctrl+g", "mini_mode_cancel"],
|
||||||
["ctrl+c", "mini_mode_cancel"],
|
["ctrl+c", "mini_mode_cancel"],
|
||||||
|
@ -266,8 +257,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mini/file_browser": {
|
"mini/file_browser": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+q", "quit"],
|
["ctrl+q", "quit"],
|
||||||
["ctrl+v", "system_paste"],
|
["ctrl+v", "system_paste"],
|
||||||
|
@ -295,8 +284,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mini/find_in_files": {
|
"mini/find_in_files": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+q", "quit"],
|
["ctrl+q", "quit"],
|
||||||
["ctrl+v", "system_paste"],
|
["ctrl+v", "system_paste"],
|
||||||
|
@ -332,8 +319,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mini/find": {
|
"mini/find": {
|
||||||
"syntax": "flow",
|
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["ctrl+q", "quit"],
|
["ctrl+q", "quit"],
|
||||||
["ctrl+v", "system_paste"],
|
["ctrl+v", "system_paste"],
|
||||||
|
@ -410,7 +395,6 @@
|
||||||
},
|
},
|
||||||
"insert": {
|
"insert": {
|
||||||
"syntax": "vim",
|
"syntax": "vim",
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["jk", "enter_mode", "normal"],
|
["jk", "enter_mode", "normal"],
|
||||||
["<Esc>", "enter_mode", "normal"]
|
["<Esc>", "enter_mode", "normal"]
|
||||||
|
@ -420,7 +404,6 @@
|
||||||
"emacs" : {
|
"emacs" : {
|
||||||
"base": {
|
"base": {
|
||||||
"syntax": "vim",
|
"syntax": "vim",
|
||||||
"on_match_failure": "insert",
|
|
||||||
"bindings": [
|
"bindings": [
|
||||||
["<C-a>", "cursor_line_start"],
|
["<C-a>", "cursor_line_start"],
|
||||||
["<C-e>", "cursor_line_end"],
|
["<C-e>", "cursor_line_end"],
|
||||||
|
|
Loading…
Add table
Reference in a new issue