Persist the default Git diff layout
This commit is contained in:
@@ -40,13 +40,6 @@ pub(super) struct GitWorktree {
|
||||
pub(super) files: Vec<GitFile>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
||||
pub(crate) enum GitDiffMode {
|
||||
#[default]
|
||||
Unified,
|
||||
Split,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub(super) enum GitDiffLineKind {
|
||||
Section,
|
||||
@@ -186,6 +179,7 @@ impl App {
|
||||
match load_diff(&worktree.root, file, &self.config.git) {
|
||||
Ok(diff) => {
|
||||
self.git_diff = Some(diff);
|
||||
self.git_diff_layout = self.config.git.diff_layout;
|
||||
self.error = None;
|
||||
}
|
||||
Err(error) => self.error = Some(error),
|
||||
@@ -1113,6 +1107,7 @@ mod tests {
|
||||
.find(|file| file.display_path == "changed.txt")
|
||||
.unwrap();
|
||||
let settings = GitConfig {
|
||||
diff_layout: GitDiffLayout::Unified,
|
||||
diff_algorithm: GitDiffAlgorithm::Patience,
|
||||
context_lines: 0,
|
||||
interhunk_lines: 0,
|
||||
|
||||
Reference in New Issue
Block a user