TermColor.Repl.Keymap #
Inspectable, ordered keyboard bindings. Contexts are values rather than callbacks, so a keymap is plain data: an application supplies the active context values for its current model.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
Equations
- TermColor.Repl.instBEqKeyContext.beq { name := a } { name := b } = (a == b)
- TermColor.Repl.instBEqKeyContext.beq x✝¹ x✝ = false
Instances For
Equations
Instances For
@[instance_reducible]
Construct an application context from one centralized name.
Equations
- TermColor.Repl.KeyContext.ofString name = { name := name }
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
- key : Widgets.Key
- action : Action
- context : Option KeyContext
- label : String
- description : String
Instances For
@[instance_reducible]
instance
TermColor.Repl.instReprKeyBinding
{Action✝ : Type}
[Repr Action✝]
:
Repr (KeyBinding Action✝)
Equations
def
TermColor.Repl.instReprKeyBinding.repr
{Action✝ : Type}
[Repr Action✝]
:
KeyBinding Action✝ → Nat → Std.Format
Equations
- One or more equations did not get rendered due to their size.
Instances For
- bindings : List (KeyBinding Action)
Instances For
@[instance_reducible]
Equations
def
TermColor.Repl.instReprKeymap.repr
{Action✝ : Type}
[Repr Action✝]
:
Keymap Action✝ → Nat → Std.Format
Equations
- One or more equations did not get rendered due to their size.
Instances For
One declarative action binding. Multiple physical keys may name one action.
- keys : List Widgets.Key
- action : Action
- context : Option KeyContext
- label : String
- description : String
Instances For
@[instance_reducible]
instance
TermColor.Repl.instReprBindingSpec
{Action✝ : Type}
[Repr Action✝]
:
Repr (BindingSpec Action✝)
Equations
def
TermColor.Repl.instReprBindingSpec.repr
{Action✝ : Type}
[Repr Action✝]
:
BindingSpec Action✝ → Nat → Std.Format
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
TermColor.Repl.BindingSpec.expand
{Action : Type}
(spec : BindingSpec Action)
:
List (KeyBinding Action)
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
TermColor.Repl.Keymap.fromSpecs
{Action : Type}
(specs : List (BindingSpec Action))
:
Keymap Action
Equations
- TermColor.Repl.Keymap.fromSpecs specs = { bindings := List.flatMap TermColor.Repl.BindingSpec.expand specs }
Instances For
def
TermColor.Repl.Keymap.resolveBinding
{Action : Type}
(keymap : Keymap Action)
(contexts : List KeyContext)
(key : Widgets.Key)
:
Option (KeyBinding Action)
First matching binding wins; list order is the precedence contract.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
TermColor.Repl.Keymap.resolve
{Action : Type}
(keymap : Keymap Action)
(contexts : List KeyContext)
(key : Widgets.Key)
:
Option Action
Resolve the first matching action.
Equations
- keymap.resolve contexts key = Option.map (fun (x : TermColor.Repl.KeyBinding Action) => x.action) (keymap.resolveBinding contexts key)
Instances For
def
TermColor.Repl.Keymap.visible
{Action : Type}
(keymap : Keymap Action)
(contexts : List KeyContext)
:
List (KeyBinding Action)
Equations
- keymap.visible contexts = List.filter (fun (binding : TermColor.Repl.KeyBinding Action) => TermColor.Repl.Keymap.active✝ contexts binding.context) keymap.bindings
Instances For
Equations
Instances For
Return duplicate key/context pairs that rely on implicit first-match precedence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- TermColor.Repl.Keymap.keyLabel (TermColor.Widgets.Key.char value) = toString value
- TermColor.Repl.Keymap.keyLabel (TermColor.Widgets.Key.ctrl value) = toString "Ctrl-" ++ toString value
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.left = "←"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.right = "→"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.home = "Home"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.end = "End"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.up = "↑"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.down = "↓"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.pageUp = "PgUp"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.pageDown = "PgDn"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.enter = "Enter"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.backspace = "Backspace"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.delete = "Delete"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.tab = "Tab"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.shiftTab = "Shift-Tab"
- TermColor.Repl.Keymap.keyLabel TermColor.Widgets.Key.escape = "Esc"
Instances For
Built-in editor bindings #
- complete : EditorAction
- completionNext : EditorAction
- completionPrevious : EditorAction
- dismissCompletion : EditorAction
- historyPrevious : EditorAction
- historyNext : EditorAction
- lineBreak : EditorAction
- submit : EditorAction
- quit : EditorAction
- forceQuit : EditorAction
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
Equations
- TermColor.Repl.instBEqEditorAction.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.