Skip to content

Commit

Permalink
Add support for options handling in log and stashes views extrawurst#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kamillo authored and IndianBoy42 committed Jun 4, 2024
1 parent 93c4274 commit 3bb10cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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`)
Expand Down
2 changes: 2 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,15 @@ impl App {
sender,
theme.clone(),
key_config.clone(),
options.clone(),
),
compare_commits_popup: CompareCommitsComponent::new(
&repo,
&queue,
sender,
theme.clone(),
key_config.clone(),
options.clone(),
),
external_editor_popup: ExternalEditorComponent::new(
theme.clone(),
Expand Down
8 changes: 6 additions & 2 deletions src/components/compare_commits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -34,6 +35,7 @@ pub struct CompareCommitsComponent {
visible: bool,
key_config: SharedKeyConfig,
queue: Queue,
options: SharedOptions,
}

impl DrawableComponent for CompareCommitsComponent {
Expand Down Expand Up @@ -172,6 +174,7 @@ impl CompareCommitsComponent {
sender: &Sender<AsyncGitNotification>,
theme: SharedTheme,
key_config: SharedKeyConfig,
options: SharedOptions,
) -> Self {
Self {
repo: repo.clone(),
Expand All @@ -194,6 +197,7 @@ impl CompareCommitsComponent {
visible: false,
key_config,
queue: queue.clone(),
options,
}
}

Expand Down Expand Up @@ -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)) =
Expand Down
8 changes: 6 additions & 2 deletions src/components/inspect_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -61,6 +62,7 @@ pub struct InspectCommitComponent {
git_diff: AsyncDiff,
visible: bool,
key_config: SharedKeyConfig,
options: SharedOptions,
}

impl DrawableComponent for InspectCommitComponent {
Expand Down Expand Up @@ -208,6 +210,7 @@ impl InspectCommitComponent {
sender: &Sender<AsyncGitNotification>,
theme: SharedTheme,
key_config: SharedKeyConfig,
options: SharedOptions,
) -> Self {
Self {
queue: queue.clone(),
Expand All @@ -229,6 +232,7 @@ impl InspectCommitComponent {
git_diff: AsyncDiff::new(repo.borrow().clone(), sender),
visible: false,
key_config,
options,
}
}

Expand Down Expand Up @@ -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)) =
Expand Down

0 comments on commit 3bb10cc

Please sign in to comment.