modified indicator in tab bar

This commit is contained in:
alice pellerin
2026-03-19 04:04:55 -05:00
parent 5908895ef9
commit 8666fb738e
2 changed files with 7 additions and 3 deletions
+7 -1
View File
@@ -32,6 +32,12 @@ fn tab_for(buffer: &Buffer, is_active: bool) -> Span<'static> {
Color::ui_grey() Color::ui_grey()
}; };
Span::from(format!(" {} ", buffer.file_name)) let modified_indicator = if buffer.has_unsaved_changes() {
"[+]"
} else {
""
};
Span::from(format!(" {}{modified_indicator} ", buffer.file_name))
.bg(background) .bg(background)
} }
-2
View File
@@ -19,12 +19,10 @@ const BYTES_PER_CHUNK: usize = 4;
const CHUNKS_PER_LINE: usize = BYTES_PER_LINE / BYTES_PER_CHUNK; const CHUNKS_PER_LINE: usize = BYTES_PER_LINE / BYTES_PER_CHUNK;
// TODO: // TODO:
// - multiple buffers (tabs)
// - search // - search
// - modifications // - modifications
// - insert/append // - insert/append
// - mode // - mode
// - how this works with edit history is strange :/
// - add to edit history when *leaving* insert mode // - add to edit history when *leaving* insert mode
// - replace-and-keep-going // - replace-and-keep-going
// - mode // - mode