From 7344d28768c43d8955bf23c183d606be08f27c64 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Mon, 10 Dec 2018 22:09:12 +0100 Subject: extract AtomEdit and Edit into new ra_text_edit crate --- crates/ra_text_edit/src/text_utils.rs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 crates/ra_text_edit/src/text_utils.rs (limited to 'crates/ra_text_edit/src/text_utils.rs') diff --git a/crates/ra_text_edit/src/text_utils.rs b/crates/ra_text_edit/src/text_utils.rs new file mode 100644 index 000000000..e3b4dc4fe --- /dev/null +++ b/crates/ra_text_edit/src/text_utils.rs @@ -0,0 +1,5 @@ +use text_unit::{TextRange, TextUnit}; + +pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool { + range.start() <= offset && offset <= range.end() +} -- cgit v1.2.3