Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/line_ending.rs')
-rw-r--r--helix-core/src/line_ending.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/helix-core/src/line_ending.rs b/helix-core/src/line_ending.rs
index 36c02a94..09e92523 100644
--- a/helix-core/src/line_ending.rs
+++ b/helix-core/src/line_ending.rs
@@ -1,9 +1,9 @@
use crate::{Rope, RopeSlice};
#[cfg(target_os = "windows")]
-pub const NATIVE_LINE_ENDING: LineEnding = LineEnding::Crlf;
+pub const DEFAULT_LINE_ENDING: LineEnding = LineEnding::Crlf;
#[cfg(not(target_os = "windows"))]
-pub const NATIVE_LINE_ENDING: LineEnding = LineEnding::LF;
+pub const DEFAULT_LINE_ENDING: LineEnding = LineEnding::LF;
/// Represents one of the valid Unicode line endings.
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
@@ -203,13 +203,6 @@ pub fn line_end_char_index(slice: &RopeSlice, line: usize) -> usize {
.unwrap_or(0)
}
-pub fn line_end_byte_index(slice: &RopeSlice, line: usize) -> usize {
- slice.line_to_byte(line + 1)
- - get_line_ending(&slice.line(line))
- .map(|le| le.as_str().len())
- .unwrap_or(0)
-}
-
/// Fetches line `line_idx` from the passed rope slice, sans any line ending.
pub fn line_without_line_ending<'a>(slice: &'a RopeSlice, line_idx: usize) -> RopeSlice<'a> {
let start = slice.line_to_char(line_idx);