config: move input mode model into config module
This commit is contained in:
parent
36b5a831fc
commit
c8a6b69bf1
2 changed files with 7 additions and 8 deletions
|
|
@ -7,7 +7,6 @@ mod parsers;
|
||||||
mod spanned;
|
mod spanned;
|
||||||
mod value;
|
mod value;
|
||||||
|
|
||||||
pub use crate::config::parsers::input_mode::InputMode;
|
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
config::{
|
config::{
|
||||||
|
|
@ -204,6 +203,12 @@ pub struct NamedAction {
|
||||||
pub action: Action,
|
pub action: Action,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct InputMode {
|
||||||
|
pub parent: Option<String>,
|
||||||
|
pub shortcuts: Vec<Shortcut>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub keymap: Option<ConfigKeymap>,
|
pub keymap: Option<ConfigKeymap>,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
config::{
|
config::{
|
||||||
Shortcut,
|
InputMode,
|
||||||
context::Context,
|
context::Context,
|
||||||
extractor::{Extractor, ExtractorError, opt, recover, str, val},
|
extractor::{Extractor, ExtractorError, opt, recover, str, val},
|
||||||
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
||||||
|
|
@ -29,12 +29,6 @@ pub enum InputModeParserError {
|
||||||
ParseShortcuts(#[source] ShortcutsParserError),
|
ParseShortcuts(#[source] ShortcutsParserError),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
|
||||||
pub struct InputMode {
|
|
||||||
pub parent: Option<String>,
|
|
||||||
pub shortcuts: Vec<Shortcut>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct InputModesParser<'a>(pub &'a Context<'a>);
|
pub struct InputModesParser<'a>(pub &'a Context<'a>);
|
||||||
|
|
||||||
impl Parser for InputModesParser<'_> {
|
impl Parser for InputModesParser<'_> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue