Skip to content

Commit

Permalink
do not copy empty selection
Browse files Browse the repository at this point in the history
  • Loading branch information
tlinford committed Mar 7, 2022
1 parent 0cacb92 commit e433944
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zellij-server/src/panes/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,11 @@ impl Grid {
// for now trim after building the selection to handle whitespace in wrapped lines
let selection: Vec<_> = selection.iter().map(|l| l.trim_end()).collect();

Some(selection.join("\n"))
if selection.is_empty() {
None
} else {
Some(selection.join("\n"))
}
}

fn update_selected_lines(&mut self, old_selection: &Selection, new_selection: &Selection) {
Expand Down

0 comments on commit e433944

Please sign in to comment.