Skip to content

Commit 9407b4e

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

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* new command-line option to override the default log file path (`--logfile`) [[@acuteenvy](https://github.com/acuteenvy)] ([#2539](https://github.com/gitui-org/gitui/pull/2539))
1616
* dx: `make check` checks Cargo.toml dependency ordering using `cargo sort` [[@naseschwarz](https://github.com/naseschwarz)]
1717
* add `use_selection_fg` to theme file to allow customizing selection foreground color [[@Upsylonbare](https://github.com/Upsylonbare)] ([#2515](https://github.com/gitui-org/gitui/pull/2515))
18+
* Support opening branches popup from all tabs [[@kpbaks](https://github.com/kpbaks)] ([#2709](https://github.com/gitui-org/gitui/pull/2709))
1819

1920
### Changed
2021
* improve error messages [[@acuteenvy](https://github.com/acuteenvy)] ([#2617](https://github.com/gitui-org/gitui/pull/2617))

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)