From 7757ab6c366f6ee4ffc596b641cd2db6ea7d2771 Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Sun, 19 May 2019 23:03:40 +0530 Subject: im happy with colors --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8bacacb..48ddbf8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,6 @@ use git2::{ Repository, Status }; use colored::*; fn main() { - println!("{:?}", env::var("GIT_DIRTY")); print!("{}", cwd()); let (branch, status) = match vcs_status() { Some((x, y)) => { @@ -12,8 +11,8 @@ fn main() { }, None => ("".into(), "".into()) }; - println!(" {} {}", branch.green(), status.dimmed()); - print!("{}", prompt_char()); + println!(" {} {}", branch, status.dimmed()); + print!("{} ", prompt_char()); } fn cwd() -> String { @@ -53,7 +52,7 @@ fn vcs_status() -> Option<(colored::ColoredString, String)> { } else { let commit = reference.peel_to_commit().unwrap(); let id = commit.id(); - branch = format!("{}", id).yellow(); + branch = format!("{:.6}", id).yellow(); } let mut repo_stat = String::new(); -- cgit v1.2.3