diff options
Diffstat (limited to 'crates/ra_editor/src')
-rw-r--r-- | crates/ra_editor/src/line_index.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_editor/src/line_index.rs b/crates/ra_editor/src/line_index.rs index aab7e4081..7eddfd502 100644 --- a/crates/ra_editor/src/line_index.rs +++ b/crates/ra_editor/src/line_index.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use crate::TextUnit; | 1 | use crate::{TextUnit, TextRange}; |
2 | use rustc_hash::FxHashMap; | 2 | use rustc_hash::FxHashMap; |
3 | use superslice::Ext; | 3 | use superslice::Ext; |
4 | 4 | ||
@@ -120,6 +120,10 @@ impl LineIndex { | |||
120 | 120 | ||
121 | col | 121 | col |
122 | } | 122 | } |
123 | |||
124 | pub fn newlines(&self) -> &[TextUnit] { | ||
125 | &self.newlines[1..] | ||
126 | } | ||
123 | } | 127 | } |
124 | 128 | ||
125 | #[test] | 129 | #[test] |