fix(mouse): mouse events not forwarded to plugin panes (#1369)

* fix mouse click and release events not forwarded to plugin panes
This commit is contained in:
Thomas Linford 2022-05-02 22:06:47 +02:00 committed by GitHub
parent 77e9dc93f7
commit bfa4942c5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1549,9 +1549,12 @@ impl Tab {
relative_position.line.0 + 1 relative_position.line.0 + 1
); );
self.write_to_active_terminal(mouse_event.into_bytes(), client_id); self.write_to_active_terminal(mouse_event.into_bytes(), client_id);
} else if let PaneId::Terminal(_) = pane.pid() { } else {
// TODO: rename this method, it is used to forward click events to plugin panes
pane.start_selection(&relative_position, client_id); pane.start_selection(&relative_position, client_id);
self.selecting_with_mouse = true; if let PaneId::Terminal(_) = pane.pid() {
self.selecting_with_mouse = true;
}
} }
}; };
} }
@ -1617,9 +1620,10 @@ impl Tab {
.min(active_pane.get_content_rows() as isize); .min(active_pane.get_content_rows() as isize);
let mouse_event = format!("\u{1b}[<0;{:?};{:?}m", col, line); let mouse_event = format!("\u{1b}[<0;{:?};{:?}m", col, line);
self.write_to_active_terminal(mouse_event.into_bytes(), client_id); self.write_to_active_terminal(mouse_event.into_bytes(), client_id);
} else if selecting { } else {
// TODO: rename this method, it is used to forward release events to plugin panes
active_pane.end_selection(&relative_position, client_id); active_pane.end_selection(&relative_position, client_id);
if copy_on_release { if selecting && copy_on_release {
let selected_text = active_pane.get_selected_text(); let selected_text = active_pane.get_selected_text();
active_pane.reset_selection(); active_pane.reset_selection();