diff options
author | Blaž Hrastnik | 2021-03-30 09:19:48 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-30 09:23:12 +0000 |
commit | 1b5316ea74845a23bebf492dd091fd1fc3a8dcaa (patch) | |
tree | 0d8113f0cba3995a5e055f63a6e1436993b34319 /helix-term/src/ui | |
parent | 88bb7a1f38764c1ae4781afecbf68a7707a60c49 (diff) |
Track document modified state.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 1103d6f5..1f4bf6bd 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -415,14 +415,15 @@ impl EditorView { if let Some(path) = doc.relative_path() { let path = path.to_string_lossy(); + + let title = format!("{}{}", path, if doc.modified() { "[+]" } else { "" }); surface.set_stringn( viewport.x + 6, viewport.y, - path, + title, viewport.width.saturating_sub(6) as usize, text_color, ); - // TODO: append [+] if modified } surface.set_string( |