Remove set-mode char event

Use generic shell commands instead.  This keeps us honest.

No functional change expected.
This commit is contained in:
Johannes Altmanninger
2024-03-30 12:10:23 +01:00
parent 20bbdb68fa
commit aa40c3fb7e
3 changed files with 11 additions and 38 deletions

View File

@@ -129,9 +129,6 @@ pub enum CharEventType {
/// A shell command.
Command(WString),
/// A request to change the input mapping mode.
SetMode(WString),
/// end-of-file was reached.
Eof,
@@ -173,7 +170,7 @@ pub fn is_readline(&self) -> bool {
pub fn is_readline_or_command(&self) -> bool {
matches!(
self.evt,
CharEventType::Readline(_) | CharEventType::Command(_) | CharEventType::SetMode(_)
CharEventType::Readline(_) | CharEventType::Command(_)
)
}
@@ -206,13 +203,6 @@ pub fn get_command(&self) -> Option<&wstr> {
}
}
pub fn get_mode(&self) -> Option<&wstr> {
match &self.evt {
CharEventType::SetMode(m) => Some(m),
_ => None,
}
}
pub fn from_char(c: char) -> CharEvent {
CharEvent {
evt: CharEventType::Char(c),
@@ -241,14 +231,6 @@ pub fn from_command(cmd: WString) -> CharEvent {
}
}
pub fn from_set_mode(mode: WString) -> CharEvent {
CharEvent {
evt: CharEventType::SetMode(mode),
input_style: CharInputStyle::Normal,
seq: WString::new(),
}
}
pub fn from_check_exit() -> CharEvent {
CharEvent {
evt: CharEventType::CheckExit,