Compare commits

...

2 Commits

Author SHA1 Message Date
Blaž Hrastnik
a1228e0aa1 Set terminal title to currently focused file 2021-10-24 16:52:38 +09:00
Blaž Hrastnik
03f2bcc60b nix: Update lld to 12 2021-10-23 15:20:45 +09:00
2 changed files with 14 additions and 1 deletions

View File

@@ -63,7 +63,7 @@
''; '';
}; };
shell = common: prev: { shell = common: prev: {
packages = prev.packages ++ (with common.pkgs; [ lld_10 lldb cargo-tarpaulin ]); packages = prev.packages ++ (with common.pkgs; [ lld_12 lldb cargo-tarpaulin ]);
env = prev.env ++ [ env = prev.env ++ [
{ name = "HELIX_RUNTIME"; eval = "$PWD/runtime"; } { name = "HELIX_RUNTIME"; eval = "$PWD/runtime"; }
{ name = "RUST_BACKTRACE"; value = "1"; } { name = "RUST_BACKTRACE"; value = "1"; }

View File

@@ -575,6 +575,19 @@ impl EditorView {
surface.set_style(viewport.with_height(1), style); surface.set_style(viewport.with_height(1), style);
if is_focused { if is_focused {
surface.set_string(viewport.x + 1, viewport.y, mode, style); surface.set_string(viewport.x + 1, viewport.y, mode, style);
// TODO: put this in a better place and possibly cache
let _ = crossterm::execute!(
std::io::stdout(),
crossterm::terminal::SetTitle(format!(
"{} - Helix",
doc.relative_path()
.as_deref()
.unwrap_or(std::path::Path::new("[scratch]"))
.to_str()
.unwrap()
))
);
} }
surface.set_string(viewport.x + 5, viewport.y, progress, style); surface.set_string(viewport.x + 5, viewport.y, progress, style);