Skip to content

Commit

Permalink
minor: Import Range too
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Nov 14, 2021
1 parent 35c974c commit 1817b7f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions helix-core/src/history.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{Assoc, ChangeSet, Rope, State, Transaction};
use crate::{Assoc, ChangeSet, Range, Rope, State, Transaction};
use once_cell::sync::Lazy;
use regex::Regex;
use std::num::NonZeroUsize;
Expand Down Expand Up @@ -148,9 +148,7 @@ impl History {
.transaction
.changes_iter()
// find a change that matches the primary selection
.find(|(from, to, _fragment)| {
crate::Range::new(*from, *to).overlaps(&primary_selection)
})
.find(|(from, to, _fragment)| Range::new(*from, *to).overlaps(&primary_selection))
// or use the first change
.or_else(|| current_revision.transaction.changes_iter().next())
.unwrap();
Expand Down

0 comments on commit 1817b7f

Please sign in to comment.