From a4f5a0134e308ffad318ab6920fe1ed0264a93cb Mon Sep 17 00:00:00 2001 From: Jan Hrastnik Date: Mon, 14 Jun 2021 15:09:54 +0200 Subject: trying out line ending helper functions in commands.rs --- helix-term/src/ui/editor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 0a646e93..d6010e6c 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -7,7 +7,7 @@ use crate::{ }; use helix_core::{ - coords_at_pos, + coords_at_pos, rope_slice_to_line_ending, syntax::{self, HighlightEvent}, Position, Range, }; @@ -179,7 +179,7 @@ impl EditorView { // iterate over range char by char for grapheme in RopeGraphemes::new(text) { - if grapheme == "\n" || grapheme == "\r\n" { + if rope_slice_to_line_ending(&grapheme).is_some() { visual_x = 0; line += 1; -- cgit v1.2.3-70-g09d2