Skip to content

Commit

Permalink
(startup) start with blame file view when cli command indicates it
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmaco committed Oct 14, 2023
1 parent f8d6c9d commit 5140d15
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use crate::{
cmdbar::CommandBar,
components::{
command_pump, event_pump, AppOption, BlameFileComponent,
BranchListComponent, CommandInfo, CommitComponent,
CompareCommitsComponent, Component, ConfirmComponent,
CreateBranchComponent, DrawableComponent,
BlameFileOpen, BranchListComponent, CommandInfo,
CommitComponent, CompareCommitsComponent, Component,
ConfirmComponent, CreateBranchComponent, DrawableComponent,
ExternalEditorComponent, FetchComponent, FileRevlogComponent,
FuzzyFindPopup, FuzzyFinderTarget, HelpComponent,
InspectCommitComponent, LogSearchPopupComponent,
Expand Down Expand Up @@ -138,6 +138,18 @@ impl App {
options.borrow().current_tab()
};

if let Some(StartMode::BlameFile { path_in_workdir }) =
start_mode
{
queue.push(InternalEvent::OpenPopup(
StackablePopupOpen::BlameFile(BlameFileOpen {
file_path: path_in_workdir.display().to_string(),
commit_id: None,
selection: None,
}),
));
}

let mut app = Self {
input,
reset: ConfirmComponent::new(
Expand Down Expand Up @@ -511,6 +523,7 @@ impl App {
self.reset_popup.update()?;

self.update_commands();
self.process_internal_events()?;

Ok(())
}
Expand Down

0 comments on commit 5140d15

Please sign in to comment.