Skip to content

Commit

Permalink
Fix background color on light mode and bump to 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cantino committed Dec 25, 2018
1 parent af59f55 commit b7edc7d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.3.1 - Dec 25, 2018
- Fix background color on Light Mode
0.3.0 - Dec 25, 2018
- Support users who have `set -o vi` (thanks @Asdalo21)
- Remove Regex dependency for a smaller binary.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mcfly"
version = "0.3.0"
version = "0.3.1"
authors = ["Andrew Cantino <[email protected]>"]
description = "McFly replaces your default ctrl-r Bash history search with an intelligent search engine that takes into account your working directory and the context of recently executed commands. McFly's suggestions are prioritized in real time with a small neural network."
license = "MIT"
Expand Down
24 changes: 17 additions & 7 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,25 @@ impl<'a> Interface<'a> {
} else {
color::Fg(color::LightWhite).to_string()
};

let mut highlight = if self.settings.lightmode {
color::Fg(color::Blue).to_string()
} else {
color::Fg(color::Green).to_string()
};

let mut bg = color::Bg(color::Reset).to_string();

if index == self.selection {
fg = color::Fg(color::Black).to_string();
bg = color::Bg(color::LightWhite).to_string();
if self.settings.lightmode {
fg = color::Fg(color::LightWhite).to_string();
bg = color::Bg(color::LightBlack).to_string();
highlight = color::Fg(color::White).to_string();
} else {
fg = color::Fg(color::Black).to_string();
bg = color::Bg(color::LightWhite).to_string();
highlight = color::Fg(color::Green).to_string();
}
}

write!(screen, "{}{}", fg, bg).unwrap();
Expand All @@ -195,11 +209,7 @@ impl<'a> Interface<'a> {
command,
&self.input.command,
width,
if self.settings.lightmode {
color::Fg(color::Blue).to_string()
} else {
color::Fg(color::Cyan).to_string()
},
highlight,
fg,
self.debug
)
Expand Down

0 comments on commit b7edc7d

Please sign in to comment.