mirror of
https://github.com/extrawurst/gitui.git
synced 2024-12-28 11:32:16 +03:00
file blame at right revision from commit-details (#1324)
This commit is contained in:
parent
30918d114c
commit
0a970db24a
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
* customizable `cmdbar_bg` theme color & screen spanning selected line bg [[@gigitsu](https://github.com/gigitsu)] ([#1299](https://github.com/extrawurst/gitui/pull/1299))
|
* customizable `cmdbar_bg` theme color & screen spanning selected line bg [[@gigitsu](https://github.com/gigitsu)] ([#1299](https://github.com/extrawurst/gitui/pull/1299))
|
||||||
* use filewatcher instead of polling updates ([#1](https://github.com/extrawurst/gitui/issues/1))
|
* use filewatcher instead of polling updates ([#1](https://github.com/extrawurst/gitui/issues/1))
|
||||||
* word motions to text input [[@Rodrigodd](https://github.com/Rodrigodd)] ([#1256](https://github.com/extrawurst/gitui/issues/1256))
|
* word motions to text input [[@Rodrigodd](https://github.com/Rodrigodd)] ([#1256](https://github.com/extrawurst/gitui/issues/1256))
|
||||||
|
* file blame at right revision from commit-details [[@heiskane](https://github.com/heiskane)] ([#1122](https://github.com/extrawurst/gitui/issues/1122))
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
* remove insecure dependency `ansi_term` ([#1290](https://github.com/extrawurst/gitui/issues/1290))
|
* remove insecure dependency `ansi_term` ([#1290](https://github.com/extrawurst/gitui/issues/1290))
|
||||||
|
@ -102,6 +102,8 @@ impl CommitDetailsComponent {
|
|||||||
self.commit = params;
|
self.commit = params;
|
||||||
|
|
||||||
if let Some(id) = params {
|
if let Some(id) = params {
|
||||||
|
self.file_tree.set_commit(Some(id.id));
|
||||||
|
|
||||||
if let Some(other) = id.other {
|
if let Some(other) = id.other {
|
||||||
self.compare_details
|
self.compare_details
|
||||||
.set_commits(Some((id.id, other)));
|
.set_commits(Some((id.id, other)));
|
||||||
|
@ -14,7 +14,7 @@ use crate::{
|
|||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::{hash, StatusItem, StatusItemType};
|
use asyncgit::{hash, sync::CommitId, StatusItem, StatusItemType};
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use std::{borrow::Cow, cell::Cell, convert::From, path::Path};
|
use std::{borrow::Cow, cell::Cell, convert::From, path::Path};
|
||||||
use tui::{backend::Backend, layout::Rect, text::Span, Frame};
|
use tui::{backend::Backend, layout::Rect, text::Span, Frame};
|
||||||
@ -35,6 +35,7 @@ pub struct StatusTreeComponent {
|
|||||||
key_config: SharedKeyConfig,
|
key_config: SharedKeyConfig,
|
||||||
scroll_top: Cell<usize>,
|
scroll_top: Cell<usize>,
|
||||||
visible: bool,
|
visible: bool,
|
||||||
|
revision: Option<CommitId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StatusTreeComponent {
|
impl StatusTreeComponent {
|
||||||
@ -58,9 +59,14 @@ impl StatusTreeComponent {
|
|||||||
scroll_top: Cell::new(0),
|
scroll_top: Cell::new(0),
|
||||||
pending: true,
|
pending: true,
|
||||||
visible: false,
|
visible: false,
|
||||||
|
revision: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_commit(&mut self, revision: Option<CommitId>) {
|
||||||
|
self.revision = revision;
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
pub fn update(&mut self, list: &[StatusItem]) -> Result<()> {
|
pub fn update(&mut self, list: &[StatusItem]) -> Result<()> {
|
||||||
self.pending = false;
|
self.pending = false;
|
||||||
@ -428,7 +434,7 @@ impl Component for StatusTreeComponent {
|
|||||||
StackablePopupOpen::BlameFile(
|
StackablePopupOpen::BlameFile(
|
||||||
BlameFileOpen {
|
BlameFileOpen {
|
||||||
file_path: status_item.path,
|
file_path: status_item.path,
|
||||||
commit_id: None,
|
commit_id: self.revision,
|
||||||
selection: None,
|
selection: None,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user