aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_text_edit/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_text_edit/src')
-rw-r--r--crates/ra_text_edit/src/lib.rs1
-rw-r--r--crates/ra_text_edit/src/text_edit.rs3
-rw-r--r--crates/ra_text_edit/src/text_utils.rs5
3 files changed, 1 insertions, 8 deletions
diff --git a/crates/ra_text_edit/src/lib.rs b/crates/ra_text_edit/src/lib.rs
index 8acf10448..22f3fdc0c 100644
--- a/crates/ra_text_edit/src/lib.rs
+++ b/crates/ra_text_edit/src/lib.rs
@@ -1,5 +1,4 @@
1mod text_edit; 1mod text_edit;
2pub mod text_utils;
3pub mod test_utils; 2pub mod test_utils;
4 3
5pub use crate::text_edit::{TextEdit, TextEditBuilder}; 4pub use crate::text_edit::{TextEdit, TextEditBuilder};
diff --git a/crates/ra_text_edit/src/text_edit.rs b/crates/ra_text_edit/src/text_edit.rs
index a288a990d..363b3d8c0 100644
--- a/crates/ra_text_edit/src/text_edit.rs
+++ b/crates/ra_text_edit/src/text_edit.rs
@@ -1,5 +1,4 @@
1use crate::AtomTextEdit; 1use crate::AtomTextEdit;
2use crate::text_utils::contains_offset_nonstrict;
3use text_unit::{TextRange, TextUnit}; 2use text_unit::{TextRange, TextUnit};
4 3
5#[derive(Debug, Clone)] 4#[derive(Debug, Clone)]
@@ -28,7 +27,7 @@ impl TextEditBuilder {
28 pub fn invalidates_offset(&self, offset: TextUnit) -> bool { 27 pub fn invalidates_offset(&self, offset: TextUnit) -> bool {
29 self.atoms 28 self.atoms
30 .iter() 29 .iter()
31 .any(|atom| contains_offset_nonstrict(atom.delete, offset)) 30 .any(|atom| atom.delete.contains_inclusive(offset))
32 } 31 }
33} 32}
34 33
diff --git a/crates/ra_text_edit/src/text_utils.rs b/crates/ra_text_edit/src/text_utils.rs
deleted file mode 100644
index e3b4dc4fe..000000000
--- a/crates/ra_text_edit/src/text_utils.rs
+++ /dev/null
@@ -1,5 +0,0 @@
1use text_unit::{TextRange, TextUnit};
2
3pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool {
4 range.start() <= offset && offset <= range.end()
5}