From 378012d799f0cd88a845314923081c34b0904ded Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Thu, 1 Jan 2015 13:16:33 -0800 Subject: [PATCH] Fixed bug in file loading where line text would still contain line endings. --- src/buffer/line.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/buffer/line.rs b/src/buffer/line.rs index 164dd99..f8a2b6b 100644 --- a/src/buffer/line.rs +++ b/src/buffer/line.rs @@ -132,7 +132,8 @@ impl Line { _ => {} } } - else if le_size == 0 && tl.text.len() >= 2 { + + if le_size == 0 && tl.text.len() >= 2 { match unsafe{mem::transmute::<&[u8], &str>(tl.text.slice_from(text_size-2))} { // CRLF "\u{000D}\u{000A}" => { @@ -143,7 +144,8 @@ impl Line { _ => {} } } - else if le_size == 0 && tl.text.len() >= 1 { + + if le_size == 0 && tl.text.len() >= 1 { match unsafe{mem::transmute::<&[u8], &str>(tl.text.slice_from(text_size-1))} { // LF or CRLF "\u{000A}" => {