Skip to content

Commit

Permalink
Exclude file persistence for autostart splits
Browse files Browse the repository at this point in the history
  • Loading branch information
useche committed Dec 30, 2024
1 parent 45fbb49 commit ca90c68
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ fn quit(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
// last view and we have unsaved changes
if cx.editor.tree.views().count() == 1 {
// save split in default before quitting
if cx.editor.config().persistence.autostart_splits {
let doc = doc!(cx.editor);
let exclude = doc.path().map_or(true, |p| {
cx.editor.persistence.exclude(&p.to_string_lossy())
});
if cx.editor.config().persistence.autostart_splits && !exclude {
cx.editor.save_split("".to_string());
}

Expand Down Expand Up @@ -803,6 +807,7 @@ fn quit_all_impl(cx: &mut compositor::Context, force: bool) -> anyhow::Result<()
}

// save split in default before quitting
// TODO: Do I need to exclude anything here?
if cx.editor.config().persistence.autostart_splits {
cx.editor.save_split("".to_string());
}
Expand Down

0 comments on commit ca90c68

Please sign in to comment.