diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-11 05:40:06 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-11 05:40:06 -0500 |
commit | 6ca82f5be15f1c6c936c82266d1f6dc13185346c (patch) | |
tree | 23a7b928f9e02ad1691c1a43f39f8d9177e06ead /src/readline.rs | |
parent | f2e345b01b8b7457bb03b7bee0c825664c95f82d (diff) | |
download | nbsh-6ca82f5be15f1c6c936c82266d1f6dc13185346c.tar.gz nbsh-6ca82f5be15f1c6c936c82266d1f6dc13185346c.zip |
tweak the output a bit more
Diffstat (limited to 'src/readline.rs')
-rw-r--r-- | src/readline.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/readline.rs b/src/readline.rs index 0be2cad..3f71c5a 100644 --- a/src/readline.rs +++ b/src/readline.rs @@ -80,6 +80,14 @@ impl Readline { out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); } out.write(b"\x1b[K"); + out.set_fgcolor(textmode::color::YELLOW); + out.write_str(&format!("{}", entry_count + 1)); + out.reset_attributes(); + if focus { + out.set_bgcolor(textmode::Color::Rgb(32, 32, 64)); + } else { + out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); + } out.write_str(" ("); out.write_str(&pwd); out.write_str(")"); @@ -91,16 +99,13 @@ impl Readline { out.move_to(self.size.0 - 1, 0); out.reset_attributes(); - let idx_str = format!("[{}]", entry_count + 1); - let idx_str_len: u16 = idx_str.len().try_into().unwrap(); - out.write_str(&idx_str); out.write_str(&prompt_char); out.write_str(" "); out.reset_attributes(); out.write(b"\x1b[K"); out.write_str(&self.input_line); out.reset_attributes(); - out.move_to(self.size.0 - 1, idx_str_len + 2 + self.pos_width()); + out.move_to(self.size.0 - 1, 2 + self.pos_width()); if focus { out.hide_cursor(false); } |