initial commit for fern's readline impl

This commit is contained in:
2025-05-15 03:35:41 -04:00
parent 645cf82ac9
commit 336c8537c0
9 changed files with 375 additions and 595 deletions

View File

@@ -1,6 +1,5 @@
use std::{collections::HashMap, fmt::Display, str::FromStr};
use rustyline::{config::BellStyle, EditMode};
use crate::{libsh::error::{Note, ShErr, ShErrKind, ShResult}, state::ShFunc};
@@ -29,17 +28,6 @@ impl FromStr for FernBellStyle {
}
}
impl From<FernBellStyle> for BellStyle {
fn from(val: FernBellStyle) -> Self {
match val {
FernBellStyle::Audible => BellStyle::Audible,
FernBellStyle::Visible => BellStyle::Visible,
FernBellStyle::Disable => BellStyle::None
}
}
}
impl Display for FernBellStyle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
@@ -56,15 +44,6 @@ pub enum FernEditMode {
Emacs
}
impl From<FernEditMode> for EditMode {
fn from(val: FernEditMode) -> Self {
match val {
FernEditMode::Vi => EditMode::Vi,
FernEditMode::Emacs => EditMode::Emacs
}
}
}
impl FromStr for FernEditMode {
type Err = ShErr;
fn from_str(s: &str) -> Result<Self, Self::Err> {