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 8b93699 commit e042dc9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ 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 exclude = doc!(cx.editor).path().map_or(true, |p| {
cx.editor.config().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,7 +806,12 @@ fn quit_all_impl(cx: &mut compositor::Context, force: bool) -> anyhow::Result<()
}

// save split in default before quitting
if cx.editor.config().persistence.autostart_splits {
let exclude = cx.editor.tree.views().all(|(v, _)| {
doc!(cx.editor, &v.doc).path().map_or(true, |p| {
cx.editor.config().persistence.exclude(&p.to_string_lossy())
})
});
if cx.editor.config().persistence.autostart_splits && !exclude {
cx.editor.save_split("".to_string());
}

Expand Down

0 comments on commit e042dc9

Please sign in to comment.