Skip to content

Commit 5140d15

Browse files
committed
(startup) start with blame file view when cli command indicates it
1 parent f8d6c9d commit 5140d15

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/app.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use crate::{
44
cmdbar::CommandBar,
55
components::{
66
command_pump, event_pump, AppOption, BlameFileComponent,
7-
BranchListComponent, CommandInfo, CommitComponent,
8-
CompareCommitsComponent, Component, ConfirmComponent,
9-
CreateBranchComponent, DrawableComponent,
7+
BlameFileOpen, BranchListComponent, CommandInfo,
8+
CommitComponent, CompareCommitsComponent, Component,
9+
ConfirmComponent, CreateBranchComponent, DrawableComponent,
1010
ExternalEditorComponent, FetchComponent, FileRevlogComponent,
1111
FuzzyFindPopup, FuzzyFinderTarget, HelpComponent,
1212
InspectCommitComponent, LogSearchPopupComponent,
@@ -138,6 +138,18 @@ impl App {
138138
options.borrow().current_tab()
139139
};
140140

141+
if let Some(StartMode::BlameFile { path_in_workdir }) =
142+
start_mode
143+
{
144+
queue.push(InternalEvent::OpenPopup(
145+
StackablePopupOpen::BlameFile(BlameFileOpen {
146+
file_path: path_in_workdir.display().to_string(),
147+
commit_id: None,
148+
selection: None,
149+
}),
150+
));
151+
}
152+
141153
let mut app = Self {
142154
input,
143155
reset: ConfirmComponent::new(
@@ -511,6 +523,7 @@ impl App {
511523
self.reset_popup.update()?;
512524

513525
self.update_commands();
526+
self.process_internal_events()?;
514527

515528
Ok(())
516529
}

0 commit comments

Comments
 (0)