Compare commits
No commits in common. "9d80a0f0fa09670066cd7f7287c4ff65387d8d5f" and "91456371346b831b5c1a95879cbe734105022a6f" have entirely different histories.
9d80a0f0fa
...
9145637134
2 changed files with 1 additions and 25 deletions
18
help.md
18
help.md
|
@ -69,24 +69,6 @@ like this:
|
||||||
This allows you to make only minor additions/changes to an existing builtin
|
This allows you to make only minor additions/changes to an existing builtin
|
||||||
mode without copying the whole mode and is easier to keep up-to-date.
|
mode without copying the whole mode and is easier to keep up-to-date.
|
||||||
|
|
||||||
Additionally, individual sub-modes may inherit all non-conflicting keybindings
|
|
||||||
from another sub-mode of the same mode by adding an `inherit` option to the
|
|
||||||
sub-mode section like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
"normal": {
|
|
||||||
"inherit": "project",
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
Multiple inheritance is supported with the `inherits` options like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
"normal": {
|
|
||||||
"inherits": ["project", "tasks"],
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Flow mode
|
## Flow mode
|
||||||
|
|
||||||
The default input mode, called just flow, is based on common GUI
|
The default input mode, called just flow, is based on common GUI
|
||||||
|
|
|
@ -386,7 +386,6 @@ const BindingSet = struct {
|
||||||
line_numbers: LineNumbers = .inherit,
|
line_numbers: LineNumbers = .inherit,
|
||||||
cursor: ?CursorShape = null,
|
cursor: ?CursorShape = null,
|
||||||
inherit: ?[]const u8 = null,
|
inherit: ?[]const u8 = null,
|
||||||
inherits: ?[][]const u8 = null,
|
|
||||||
selection: ?SelectionStyle = null,
|
selection: ?SelectionStyle = null,
|
||||||
};
|
};
|
||||||
const parsed = try std.json.parseFromValue(JsonConfig, allocator, mode_bindings, .{
|
const parsed = try std.json.parseFromValue(JsonConfig, allocator, mode_bindings, .{
|
||||||
|
@ -401,12 +400,7 @@ const BindingSet = struct {
|
||||||
self.selection_style = parsed.value.selection orelse .normal;
|
self.selection_style = parsed.value.selection orelse .normal;
|
||||||
try self.load_event(allocator, &self.press, input.event.press, parsed.value.press);
|
try self.load_event(allocator, &self.press, input.event.press, parsed.value.press);
|
||||||
try self.load_event(allocator, &self.release, input.event.release, parsed.value.release);
|
try self.load_event(allocator, &self.release, input.event.release, parsed.value.release);
|
||||||
if (parsed.value.inherits) |sibling_fallbacks| {
|
if (parsed.value.inherit) |sibling_fallback| {
|
||||||
for (sibling_fallbacks) |sibling_fallback| if (namespace.get_mode(sibling_fallback)) |sib| {
|
|
||||||
for (sib.press.items) |binding| try append_if_not_match(allocator, &self.press, binding);
|
|
||||||
for (sib.release.items) |binding| try append_if_not_match(allocator, &self.release, binding);
|
|
||||||
};
|
|
||||||
} else if (parsed.value.inherit) |sibling_fallback| {
|
|
||||||
if (namespace.get_mode(sibling_fallback)) |sib| {
|
if (namespace.get_mode(sibling_fallback)) |sib| {
|
||||||
for (sib.press.items) |binding| try append_if_not_match(allocator, &self.press, binding);
|
for (sib.press.items) |binding| try append_if_not_match(allocator, &self.press, binding);
|
||||||
for (sib.release.items) |binding| try append_if_not_match(allocator, &self.release, binding);
|
for (sib.release.items) |binding| try append_if_not_match(allocator, &self.release, binding);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue