on master help sign in
minor: Import Range too
1817b7fBlaž Hrastnik
helix-core/src/history.rs+2−4
@@ -1,4 +1,4 @@
1−use crate::{Assoc, ChangeSet, Rope, State, Transaction};
1+use crate::{Assoc, ChangeSet, Range, Rope, State, Transaction};
2use once_cell::sync::Lazy;
2use once_cell::sync::Lazy;
3use regex::Regex;
3use regex::Regex;
4use std::num::NonZeroUsize;
4use std::num::NonZeroUsize;
@@ -148,9 +148,7 @@ impl History {
148 .transaction
148 .transaction
149 .changes_iter()
149 .changes_iter()
150 // find a change that matches the primary selection
150 // find a change that matches the primary selection
151− .find(|(from, to, _fragment)| {
152− crate::Range::new(*from, *to).overlaps(&primary_selection)
151+ .find(|(from, to, _fragment)| Range::new(*from, *to).overlaps(&primary_selection))
153− })
154 // or use the first change
152 // or use the first change
155 .or_else(|| current_revision.transaction.changes_iter().next())
153 .or_else(|| current_revision.transaction.changes_iter().next())
156 .unwrap();
154 .unwrap();