diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f5ab8c7e3..30215da654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * crashes on entering submodules ([#1510](https://github.com/extrawurst/gitui/issues/1510)) * fix race issue: revlog messages sometimes appear empty ([#1473](https://github.com/extrawurst/gitui/issues/1473)) * default to tick-based updates [[@cruessler](https://github.com/cruessler)] ([#1444](https://github.com/extrawurst/gitui/issues/1444)) +* add support for options handling in log and stashes views [[@kamillo](https://github.com/kamillo)] ([#1661](https://github.com/extrawurst/gitui/issues/1661)) ### Changed * minimum supported rust version bumped to 1.64 (thank you `clap`) diff --git a/src/app.rs b/src/app.rs index 26ce4647bd..75d9bb9775 100644 --- a/src/app.rs +++ b/src/app.rs @@ -180,6 +180,7 @@ impl App { sender, theme.clone(), key_config.clone(), + options.clone(), ), compare_commits_popup: CompareCommitsComponent::new( &repo, @@ -187,6 +188,7 @@ impl App { sender, theme.clone(), key_config.clone(), + options.clone(), ), external_editor_popup: ExternalEditorComponent::new( theme.clone(), diff --git a/src/components/compare_commits.rs b/src/components/compare_commits.rs index 6fa1186ece..bd92750a30 100644 --- a/src/components/compare_commits.rs +++ b/src/components/compare_commits.rs @@ -6,13 +6,14 @@ use super::{ use crate::{ accessors, keys::{key_match, SharedKeyConfig}, + options::SharedOptions, queue::{InternalEvent, Queue, StackablePopupOpen}, strings, ui::style::SharedTheme, }; use anyhow::Result; use asyncgit::{ - sync::{self, diff::DiffOptions, CommitId, RepoPathRef}, + sync::{self, CommitId, RepoPathRef}, AsyncDiff, AsyncGitNotification, CommitFilesParams, DiffParams, DiffType, }; @@ -34,6 +35,7 @@ pub struct CompareCommitsComponent { visible: bool, key_config: SharedKeyConfig, queue: Queue, + options: SharedOptions, } impl DrawableComponent for CompareCommitsComponent { @@ -172,6 +174,7 @@ impl CompareCommitsComponent { sender: &Sender, theme: SharedTheme, key_config: SharedKeyConfig, + options: SharedOptions, ) -> Self { Self { repo: repo.clone(), @@ -194,6 +197,7 @@ impl CompareCommitsComponent { visible: false, key_config, queue: queue.clone(), + options, } } @@ -256,7 +260,7 @@ impl CompareCommitsComponent { let diff_params = DiffParams { path: f.path.clone(), diff_type: DiffType::Commits(ids), - options: DiffOptions::default(), + options: self.options.borrow().diff_options(), }; if let Some((params, last)) = diff --git a/src/components/inspect_commit.rs b/src/components/inspect_commit.rs index 63cf2f8295..0ddcd30bee 100644 --- a/src/components/inspect_commit.rs +++ b/src/components/inspect_commit.rs @@ -6,13 +6,14 @@ use super::{ use crate::{ accessors, keys::{key_match, SharedKeyConfig}, + options::SharedOptions, queue::{InternalEvent, Queue, StackablePopupOpen}, strings, ui::style::SharedTheme, }; use anyhow::Result; use asyncgit::{ - sync::{diff::DiffOptions, CommitId, CommitTags, RepoPathRef}, + sync::{CommitId, CommitTags, RepoPathRef}, AsyncDiff, AsyncGitNotification, DiffParams, DiffType, }; use crossbeam_channel::Sender; @@ -61,6 +62,7 @@ pub struct InspectCommitComponent { git_diff: AsyncDiff, visible: bool, key_config: SharedKeyConfig, + options: SharedOptions, } impl DrawableComponent for InspectCommitComponent { @@ -208,6 +210,7 @@ impl InspectCommitComponent { sender: &Sender, theme: SharedTheme, key_config: SharedKeyConfig, + options: SharedOptions, ) -> Self { Self { queue: queue.clone(), @@ -229,6 +232,7 @@ impl InspectCommitComponent { git_diff: AsyncDiff::new(repo.borrow().clone(), sender), visible: false, key_config, + options, } } @@ -272,7 +276,7 @@ impl InspectCommitComponent { diff_type: DiffType::Commit( request.commit_id, ), - options: DiffOptions::default(), + options: self.options.borrow().diff_options(), }; if let Some((params, last)) =