initial commit for fern's readline impl
This commit is contained in:
21
src/shopt.rs
21
src/shopt.rs
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user