Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit b7eddb0

Browse files
author
crolbar
committed
windows double click solution
1 parent 8a54803 commit b7eddb0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

selector/src/update.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,18 @@ pub fn update(app: &mut Selector, tui: &mut Tui) -> Result<()> {
8181
MouseEventKind::ScrollDown => app.sel_next_item(),
8282
MouseEventKind::ScrollUp => app.sel_prev_item(),
8383
MouseEventKind::Down(_) => {
84+
#[cfg(target_os = "windows")]
85+
let tmp_sel = app.table_state.selected().unwrap();
86+
8487
app.handle_mb_down(mouse_ev);
8588
tui.draw(app)?;
8689

90+
#[cfg(target_os = "windows")]
91+
if app.table_state.selected().unwrap() == tmp_sel {
92+
app.exit = true
93+
}
94+
95+
#[cfg(not(target_os = "windows"))]
8796
if let Ok(Event::Mouse(MouseEvent { kind: MouseEventKind::Up(_), .. })) = event::read() {
8897
if crossterm::event::poll(std::time::Duration::from_millis(200))? {
8998
if let Ok(Event::Mouse(MouseEvent { kind: MouseEventKind::Down(_), .. })) = event::read() {

0 commit comments

Comments
 (0)