Skip to content

Commit

Permalink
Do not always set dirty flag in clear_selection
Browse files Browse the repository at this point in the history
Check if the selection was changed before setting the dirty flag.
  • Loading branch information
Greg Depoire--Ferrer committed Jul 14, 2022
1 parent 5aac3a6 commit f2257be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions alacritty/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon
}

fn clear_selection(&mut self) {
self.terminal.selection = None;
*self.dirty = true;
let old_selection = self.terminal.selection.take();
let was_empty = old_selection.map(|s| s.is_empty()).unwrap_or(true);
*self.dirty |= !was_empty;
}

fn update_selection(&mut self, mut point: Point, side: Side) {
Expand Down

0 comments on commit f2257be

Please sign in to comment.