Skip to content

Commit

Permalink
fix(mouse): selection not ending on mouse release with copy_on_select…
Browse files Browse the repository at this point in the history
… set to false (#2086)
  • Loading branch information
tlinford authored Jan 12, 2023
1 parent 3da1cbf commit 5227909
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions zellij-server/src/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2371,17 +2371,20 @@ impl Tab {
} else {
let relative_position = active_pane.relative_position(position);
if let PaneId::Terminal(_) = active_pane.pid() {
if selecting && copy_on_release {
if selecting {
active_pane.end_selection(&relative_position, client_id);
let selected_text = active_pane.get_selected_text();
active_pane.reset_selection();

if let Some(selected_text) = selected_text {
self.write_selection_to_clipboard(&selected_text)
.with_context(err_context)?;
if copy_on_release {
let selected_text = active_pane.get_selected_text();
active_pane.reset_selection();

if let Some(selected_text) = selected_text {
self.write_selection_to_clipboard(&selected_text)
.with_context(err_context)?;
}
}
}
} else {
// notify the release event to a plugin pane, should be renamed
active_pane.end_selection(&relative_position, client_id);
}

Expand Down

0 comments on commit 5227909

Please sign in to comment.