inquire/prompts/editor/action.rs
1use crate::{ui::Key, InnerAction};
2
3use super::config::EditorConfig;
4
5/// Set of actions for an EditorPrompt.
6#[derive(Copy, Clone, Debug, PartialEq, Eq)]
7pub enum EditorPromptAction {
8 /// Open the editor.
9 OpenEditor,
10}
11
12impl InnerAction for EditorPromptAction {
13 type Config = EditorConfig;
14
15 fn from_key(key: Key, _config: &EditorConfig) -> Option<Self> {
16 let action = match key {
17 Key::Char('e', _) => Self::OpenEditor,
18 _ => return None,
19 };
20
21 Some(action)
22 }
23}