Skip to content

Commit 825f43f

Browse files
committed
(refactor) use command_pump
1 parent 41dc4c3 commit 825f43f

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/app.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use crate::{
22
accessors,
33
cmdbar::CommandBar,
44
components::{
5-
event_pump, AppOption, BlameFileComponent,
6-
BranchListComponent, CommandBlocking, CommandInfo,
7-
CommitComponent, CompareCommitsComponent, Component,
8-
ConfirmComponent, CreateBranchComponent, DrawableComponent,
5+
command_pump, event_pump, AppOption, BlameFileComponent,
6+
BranchListComponent, CommandInfo, CommitComponent,
7+
CompareCommitsComponent, Component, ConfirmComponent,
8+
CreateBranchComponent, DrawableComponent,
99
ExternalEditorComponent, FetchComponent, FileFindPopup,
1010
FileRevlogComponent, HelpComponent, InspectCommitComponent,
1111
MsgComponent, OptionsPopupComponent, PullComponent,
@@ -1054,14 +1054,7 @@ impl App {
10541054
fn commands(&self, force_all: bool) -> Vec<CommandInfo> {
10551055
let mut res = Vec::new();
10561056

1057-
for c in self.components() {
1058-
if c.commands(&mut res, force_all)
1059-
!= CommandBlocking::PassingOn
1060-
&& !force_all
1061-
{
1062-
break;
1063-
}
1064-
}
1057+
command_pump(&mut res, force_all, &self.components());
10651058

10661059
res.push(CommandInfo::new(
10671060
strings::commands::find_file(&self.key_config),

0 commit comments

Comments
 (0)