From aeb08223486f1cac957f8639a9fa36b820ed5bf8 Mon Sep 17 00:00:00 2001 From: Rod Kay Date: Sun, 28 Aug 2022 22:33:58 +1000 Subject: [PATCH] lace.text.cursor: Fix bug in the 'advance' procedure. --- 1-base/lace/source/text/lace-text-cursor.adb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/1-base/lace/source/text/lace-text-cursor.adb b/1-base/lace/source/text/lace-text-cursor.adb index 5a56503..aa5f006 100644 --- a/1-base/lace/source/text/lace-text-cursor.adb +++ b/1-base/lace/source/text/lace-text-cursor.adb @@ -80,7 +80,7 @@ is elsif Count = Repeat + 1 then - Self.Current := delimiter_Position - 1; + Self.Current := delimiter_Position; else Self.Current := delimiter_Position + Delimiter'Length - 1; @@ -143,8 +143,9 @@ is declare use ada.Strings.fixed, ada.Strings.Maps.Constants; - delimiter_Position : constant Natural := (if match_Case then Index (Self.Target.Data, Delimiter, from => Self.Current) - else Index (Self.Target.Data, to_Lower (Delimiter), from => Self.Current, mapping => lower_case_Map)); + delimiter_Position : constant Natural := (if match_Case then Index (Self.Target.Data (Self.Current .. Self.Target.Length), Delimiter, from => Self.Current) + else Index (Self.Target.Data (Self.Current .. Self.Target.Length), to_Lower (Delimiter), from => Self.Current, + mapping => lower_case_Map)); begin -- put_Line ("delimiter_Position" & delimiter_Position'Image);