moved key sequences also
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
// src/config/binds.rs
|
// src/config/binds.rs
|
||||||
|
|
||||||
pub mod config;
|
pub mod config;
|
||||||
|
pub mod key_sequences;
|
||||||
|
|
||||||
pub use config::*;
|
pub use config::*;
|
||||||
|
pub use key_sequences::*;
|
||||||
|
|||||||
@@ -355,13 +355,13 @@ impl Config {
|
|||||||
|
|
||||||
// Get string representations of the sequence
|
// Get string representations of the sequence
|
||||||
let sequence_str = sequence.iter()
|
let sequence_str = sequence.iter()
|
||||||
.map(|k| crate::config::key_sequences::key_to_string(k))
|
.map(|k| crate::config::binds::key_sequences::key_to_string(k))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("");
|
.join("");
|
||||||
|
|
||||||
// Add the missing sequence_plus definition
|
// Add the missing sequence_plus definition
|
||||||
let sequence_plus = sequence.iter()
|
let sequence_plus = sequence.iter()
|
||||||
.map(|k| crate::config::key_sequences::key_to_string(k))
|
.map(|k| crate::config::binds::key_sequences::key_to_string(k))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("+");
|
.join("+");
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ impl Config {
|
|||||||
// Special case for + format in bindings
|
// Special case for + format in bindings
|
||||||
if binding.contains('+') {
|
if binding.contains('+') {
|
||||||
let normalized_sequence = sequence.iter()
|
let normalized_sequence = sequence.iter()
|
||||||
.map(|k| crate::config::key_sequences::key_to_string(k))
|
.map(|k| crate::config::binds::key_sequences::key_to_string(k))
|
||||||
.collect::<Vec<String>>();
|
.collect::<Vec<String>>();
|
||||||
|
|
||||||
let binding_parts: Vec<&str> = binding.split('+').collect();
|
let binding_parts: Vec<&str> = binding.split('+').collect();
|
||||||
@@ -442,7 +442,7 @@ impl Config {
|
|||||||
|
|
||||||
// Get string representation of the sequence
|
// Get string representation of the sequence
|
||||||
let sequence_str = sequence.iter()
|
let sequence_str = sequence.iter()
|
||||||
.map(|k| crate::config::key_sequences::key_to_string(k))
|
.map(|k| crate::config::binds::key_sequences::key_to_string(k))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("");
|
.join("");
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ impl Config {
|
|||||||
if binding.contains('+') {
|
if binding.contains('+') {
|
||||||
let binding_parts: Vec<&str> = binding.split('+').collect();
|
let binding_parts: Vec<&str> = binding.split('+').collect();
|
||||||
let sequence_parts = sequence.iter()
|
let sequence_parts = sequence.iter()
|
||||||
.map(|k| crate::config::key_sequences::key_to_string(k))
|
.map(|k| crate::config::binds::key_sequences::key_to_string(k))
|
||||||
.collect::<Vec<String>>();
|
.collect::<Vec<String>>();
|
||||||
|
|
||||||
if binding_parts.len() > sequence_parts.len() {
|
if binding_parts.len() > sequence_parts.len() {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// src/config/mod.rs
|
// src/config/mod.rs
|
||||||
pub mod key_sequences;
|
|
||||||
|
|
||||||
pub mod binds;
|
pub mod binds;
|
||||||
pub mod colors;
|
pub mod colors;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::config::binds::config::Config;
|
|||||||
use crate::ui::handlers::form::FormState;
|
use crate::ui::handlers::form::FormState;
|
||||||
use crate::ui::handlers::rat_state::UiStateHandler;
|
use crate::ui::handlers::rat_state::UiStateHandler;
|
||||||
use crate::modes::handlers::{edit, command_mode, read_only};
|
use crate::modes::handlers::{edit, command_mode, read_only};
|
||||||
use crate::config::key_sequences::KeySequenceTracker;
|
use crate::config::binds::key_sequences::KeySequenceTracker;
|
||||||
use super::common;
|
use super::common;
|
||||||
|
|
||||||
pub struct EventHandler {
|
pub struct EventHandler {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
use crossterm::event::{KeyEvent};
|
use crossterm::event::{KeyEvent};
|
||||||
use crate::config::binds::config::Config;
|
use crate::config::binds::config::Config;
|
||||||
use crate::ui::handlers::form::FormState;
|
use crate::ui::handlers::form::FormState;
|
||||||
use crate::config::key_sequences::KeySequenceTracker;
|
use crate::config::binds::key_sequences::KeySequenceTracker;
|
||||||
use crate::tui::terminal::grpc_client::GrpcClient;
|
use crate::tui::terminal::grpc_client::GrpcClient;
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq)]
|
||||||
|
|||||||
Reference in New Issue
Block a user