summaryrefslogtreecommitdiff
path: root/src/tagline.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/tagline.zig')
-rw-r--r--src/tagline.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tagline.zig b/src/tagline.zig
index 5ed65c26..68fa2645 100644
--- a/src/tagline.zig
+++ b/src/tagline.zig
@@ -26,6 +26,12 @@ pub const command_pane_tail = " " ++ config.command_pane_builtins_str;
/// The mark a tag carried after an unsaved file's name before the grip
/// showed it; a dump from then still has it in its saved tags.
const dirty_marker = " *";
+
+/// A file with changes it has not saved.
+pub fn dirty(pane: *const panes.Pane) bool {
+ const f = pane.file orelse return false;
+ return panes.Output.fileTraits(f.output).saves and f.revision != f.saved_revision;
+}
pub const legacy_pane_tail = " Del";
pub const legacy_file_pane_tail = " Save Del";
// The defaults from the release before Newtty joined every tagline. Recognized
@@ -384,6 +390,7 @@ pub fn enterHeader(p: *Pardes, column: ?usize) void {
if (p.panes[p.active]) |pane| pane.focus = .body;
p.header_focus = true;
p.header_column = column;
+ if (column) |c| p.setActiveColumn(c);
const t = focusedHeader(p) orelse return exitHeader(p);
const text = edit.flatSurface(p, t) catch "";
const rows = modal.cursorLineCount(text);