mirror of
https://github.com/nushell/nushell
synced 2025-01-13 13:49:21 +00:00
Fix formatting
This commit is contained in:
parent
db218e06dc
commit
2d4a225e2a
2 changed files with 16 additions and 6 deletions
11
src/cli.rs
11
src/cli.rs
|
@ -398,10 +398,13 @@ pub async fn cli() -> Result<(), Box<dyn Error>> {
|
||||||
let prompt = {
|
let prompt = {
|
||||||
#[cfg(feature = "starship-prompt")]
|
#[cfg(feature = "starship-prompt")]
|
||||||
{
|
{
|
||||||
let bytes = strip_ansi_escapes::strip(&starship::print::get_prompt(starship::context::Context::new_with_dir(
|
let bytes = strip_ansi_escapes::strip(&starship::print::get_prompt(
|
||||||
clap::ArgMatches::default(),
|
starship::context::Context::new_with_dir(
|
||||||
cwd.clone(),
|
clap::ArgMatches::default(),
|
||||||
))).unwrap();
|
cwd.clone(),
|
||||||
|
),
|
||||||
|
))
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
String::from_utf8_lossy(&bytes).to_string()
|
String::from_utf8_lossy(&bytes).to_string()
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,10 @@ pub(crate) struct Helper {
|
||||||
|
|
||||||
impl Helper {
|
impl Helper {
|
||||||
pub(crate) fn new(context: Context) -> Helper {
|
pub(crate) fn new(context: Context) -> Helper {
|
||||||
Helper { context, colored_prompt: String::new() }
|
Helper {
|
||||||
|
context,
|
||||||
|
colored_prompt: String::new(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +45,11 @@ impl Hinter for Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Highlighter for Helper {
|
impl Highlighter for Helper {
|
||||||
fn highlight_prompt<'b, 's: 'b, 'p: 'b>(&'s self, prompt: &'p str, default: bool) -> Cow<'b, str> {
|
fn highlight_prompt<'b, 's: 'b, 'p: 'b>(
|
||||||
|
&'s self,
|
||||||
|
prompt: &'p str,
|
||||||
|
default: bool,
|
||||||
|
) -> Cow<'b, str> {
|
||||||
use std::borrow::Cow::Borrowed;
|
use std::borrow::Cow::Borrowed;
|
||||||
|
|
||||||
if default {
|
if default {
|
||||||
|
|
Loading…
Reference in a new issue