Skip to content

Commit 55da5d9

Browse files
andrea-berlingextrawurst
authored andcommitted
Move goto_line_popup up the components list for proper event handling
Remove unnecessary goto_line_popup_is_open boolean
1 parent 9c526de commit 55da5d9

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ impl App {
474474
msg_popup,
475475
confirm_popup,
476476
commit_popup,
477+
goto_line_popup,
477478
blame_file_popup,
478479
file_revlog_popup,
479480
stashmsg_popup,
@@ -498,8 +499,7 @@ impl App {
498499
status_tab,
499500
files_tab,
500501
stashing_tab,
501-
stashlist_tab,
502-
goto_line_popup
502+
stashlist_tab
503503
]
504504
);
505505

src/popups/blame_file.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub struct BlameFilePopup {
9797
app_sender: Sender<AsyncAppNotification>,
9898
git_sender: Sender<AsyncGitNotification>,
9999
repo: RepoPathRef,
100-
goto_line_popup_is_open: bool,
101100
}
102101

103102
impl DrawableComponent for BlameFilePopup {
@@ -254,7 +253,7 @@ impl Component for BlameFilePopup {
254253
&mut self,
255254
event: &crossterm::event::Event,
256255
) -> Result<EventState> {
257-
if self.is_visible() && !self.goto_line_popup_is_open {
256+
if self.is_visible() {
258257
if let Event::Key(key) = event {
259258
if key_match(key, self.key_config.keys.exit_popup) {
260259
self.hide_stacked(false);
@@ -322,7 +321,6 @@ impl Component for BlameFilePopup {
322321
key,
323322
self.key_config.keys.goto_line,
324323
) {
325-
self.goto_line_popup_is_open = true;
326324
self.hide_stacked(true);
327325
self.visible = true;
328326
self.queue.push(InternalEvent::OpenPopup(
@@ -365,7 +363,6 @@ impl BlameFilePopup {
365363
git_sender: env.sender_git.clone(),
366364
blame: None,
367365
repo: env.repo.clone(),
368-
goto_line_popup_is_open: false,
369366
}
370367
}
371368

@@ -400,7 +397,6 @@ impl BlameFilePopup {
400397
)));
401398
self.table_state.get_mut().select(Some(0));
402399
self.visible = true;
403-
self.goto_line_popup_is_open = false;
404400
self.update()?;
405401

406402
Ok(())

0 commit comments

Comments
 (0)