Skip to content

Commit 1153424

Browse files
committed
Open branches popup from all tabs
1 parent fd46b9a commit 1153424

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

src/components/revision_files.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,13 @@ impl Component for RevisionFilesComponent {
446446
)
447447
.order(order::RARE_ACTION),
448448
);
449+
out.push(CommandInfo::new(
450+
strings::commands::open_branch_select_popup(
451+
&self.key_config,
452+
),
453+
true,
454+
self.is_visible() || force_all, // (self.visible && !self.is_search_pending()) || force_all,
455+
));
449456
tree_nav_cmds(&self.tree, &self.key_config, out);
450457
} else {
451458
self.current_file.commands(out, force_all);
@@ -523,6 +530,12 @@ impl Component for RevisionFilesComponent {
523530
);
524531
}
525532
return Ok(EventState::Consumed);
533+
} else if key_match(
534+
key,
535+
self.key_config.keys.select_branch,
536+
) {
537+
self.queue.push(InternalEvent::SelectBranch);
538+
return Ok(EventState::Consumed);
526539
} else if !is_tree_focused {
527540
return self.current_file.event(event);
528541
}

src/tabs/stashing.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ impl Component for Stashing {
199199
self.visible,
200200
self.visible || force_all,
201201
));
202+
out.push(CommandInfo::new(
203+
strings::commands::open_branch_select_popup(
204+
&self.key_config,
205+
),
206+
true,
207+
true,
208+
));
202209
}
203210

204211
visibility_blocking(self)
@@ -242,6 +249,12 @@ impl Component for Stashing {
242249
!self.options.stash_untracked;
243250
self.update()?;
244251
Ok(EventState::Consumed)
252+
} else if key_match(
253+
k,
254+
self.key_config.keys.select_branch,
255+
) {
256+
self.queue.push(InternalEvent::SelectBranch);
257+
return Ok(EventState::Consumed);
245258
} else {
246259
Ok(EventState::NotConsumed)
247260
};

src/tabs/stashlist.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ impl Component for StashList {
182182
selection_valid,
183183
true,
184184
));
185+
out.push(CommandInfo::new(
186+
strings::commands::open_branch_select_popup(
187+
&self.key_config,
188+
),
189+
true,
190+
true,
191+
));
185192
}
186193

187194
visibility_blocking(self)
@@ -214,6 +221,12 @@ impl Component for StashList {
214221
self.key_config.keys.stash_open,
215222
) {
216223
self.inspect();
224+
} else if key_match(
225+
k,
226+
self.key_config.keys.select_branch,
227+
) {
228+
self.queue.push(InternalEvent::SelectBranch);
229+
return Ok(EventState::Consumed);
217230
}
218231
}
219232
}

0 commit comments

Comments
 (0)