aboutsummaryrefslogtreecommitdiff
path: root/helix-tui/src/text.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-06-22 02:09:19 +0000
committerGitHub2021-06-22 02:09:19 +0000
commita70de6e980ec58cabf58c33e8b91bfafbea312eb (patch)
tree476c07b84ee3f399eb55c8b549641a59eedc4e1c /helix-tui/src/text.rs
parentc704970fd71a1a29ef8397ff2ab9e12c5b780a81 (diff)
parentf2954fa153ccb6b147d8d38020341a2f1b0b6df2 (diff)
Merge pull request #224 from helix-editor/line_ending_detection
Line ending detection
Diffstat (limited to 'helix-tui/src/text.rs')
-rw-r--r--helix-tui/src/text.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-tui/src/text.rs b/helix-tui/src/text.rs
index c671e918..b23bfd81 100644
--- a/helix-tui/src/text.rs
+++ b/helix-tui/src/text.rs
@@ -47,6 +47,7 @@
//! ]);
//! ```
use crate::style::Style;
+use helix_core::line_ending::str_is_line_ending;
use std::borrow::Cow;
use unicode_segmentation::UnicodeSegmentation;
use unicode_width::UnicodeWidthStr;
@@ -177,7 +178,7 @@ impl<'a> Span<'a> {
symbol: g,
style: base_style.patch(self.style),
})
- .filter(|s| s.symbol != "\n")
+ .filter(|s| !str_is_line_ending(s.symbol))
}
}