summaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-01-31 14:29:36 +0100
committerCanop <cano.petrole@gmail.com>2022-01-31 14:29:36 +0100
commit17fe0eeb4fa4c1a9024447d8b46e635c0994c4af (patch)
treeecc9c33718a796472890325922579d34811979c0 /src/command
parentc7f78ef4998193ed34a92e938d015c1c90e1b5f5 (diff)
use crokey to clean keybinding related code
Diffstat (limited to 'src/command')
-rw-r--r--src/command/panel_input.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/command/panel_input.rs b/src/command/panel_input.rs
index 7f097c0..6ccc57a 100644
--- a/src/command/panel_input.rs
+++ b/src/command/panel_input.rs
@@ -8,6 +8,7 @@ use {
skin::PanelSkin,
verb::*,
},
+ crokey::key,
crossterm::{
cursor,
event::{
@@ -224,7 +225,7 @@ impl PanelInput {
// we first handle the cases that MUST absolutely
// not be overriden by configuration
- if key == crokey::ESC {
+ if key == key!(esc) {
// tab cycling
self.tab_cycle_count = 0;
if let Some(raw) = self.input_before_cycle.take() {
@@ -250,7 +251,7 @@ impl PanelInput {
}
// tab completion
- if key == crokey::TAB {
+ if key == key!(tab) {
if parts.verb_invocation.is_some() {
let parts_before_cycle;
let completable_parts = if let Some(s) = &self.input_before_cycle {
@@ -298,11 +299,11 @@ impl PanelInput {
self.input_before_cycle = None;
}
- if key == crokey::ENTER && parts.has_not_empty_verb_invocation() {
+ if key == key!(enter) && parts.has_not_empty_verb_invocation() {
return Command::from_parts(parts, true);
}
- if key == crokey::QUESTION && (raw.is_empty() || parts.verb_invocation.is_some()) {
+ if key == key!('?') && (raw.is_empty() || parts.verb_invocation.is_some()) {
// a '?' opens the help when it's the first char
// or when it's part of the verb invocation
return Command::Internal {