-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9f6f05
commit f6080b0
Showing
7 changed files
with
43 additions
and
60 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use std::collections::HashMap; | ||
|
||
use shrs::{ | ||
anyhow, | ||
prelude::{Context, Highlighter, Runtime, Shell}, | ||
}; | ||
|
||
use crate::ChangeLangCtx; | ||
|
||
pub struct LangOptions { | ||
highlighters: HashMap<String, Box<dyn Highlighter>>, | ||
} | ||
impl LangOptions { | ||
pub fn new(highlighters: HashMap<String, Box<dyn Highlighter>>) -> Self { | ||
LangOptions { highlighters } | ||
} | ||
} | ||
impl Default for LangOptions { | ||
fn default() -> Self { | ||
let highlighters: HashMap<String, Box<dyn Highlighter>> = HashMap::from([]); | ||
Self { highlighters } | ||
} | ||
} | ||
pub(crate) fn swap_lang_options( | ||
sh: &Shell, | ||
sh_ctx: &mut Context, | ||
sh_rt: &mut Runtime, | ||
ctx: &ChangeLangCtx, | ||
) -> anyhow::Result<()> { | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters