From 953edb96041e1d28c01f4af2917dca2774c1fe21 Mon Sep 17 00:00:00 2001 From: Rod Kay Date: Thu, 11 Aug 2022 12:31:54 +1000 Subject: [PATCH] lace.text.cursor: Handle 'CR/LF' end of lines. --- 1-base/lace/source/text/lace-text-cursor.adb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/1-base/lace/source/text/lace-text-cursor.adb b/1-base/lace/source/text/lace-text-cursor.adb index 5604fd7..d1cca6a 100644 --- a/1-base/lace/source/text/lace-text-cursor.adb +++ b/1-base/lace/source/text/lace-text-cursor.adb @@ -161,9 +161,15 @@ is function next_Line (Self : in out item; Trim : in Boolean := False) return String is use ada.Characters; + Token : constant String := next_Token (Self, Delimiter => latin_1.LF, + Trim => Trim); begin - return next_Token (Self, Delimiter => latin_1.LF, - Trim => Trim); + if Token (Token'Last) = latin_1.CR + then + return Token (Token'First .. Token'Last - 1); + else + return Token; + end if; end next_Line;