summaryrefslogtreecommitdiff
path: root/src/adapad.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/adapad.adb')
-rw-r--r--src/adapad.adb15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/adapad.adb b/src/adapad.adb
index 7440ce9..bea6b91 100644
--- a/src/adapad.adb
+++ b/src/adapad.adb
@@ -282,10 +282,19 @@ function Adapad return Integer is
(This : in Do_Find_Callback;
Item : in String;
Match_Case : in Boolean) is
+
+ Current_Position : Natural;
+ Found_At : Natural;
+
begin
- Ada.Text_IO.Put_Line ("Finding " & Item);
- if Match_Case then
- Ada.Text_IO.Put_Line ("Matching case");
+ Find.Hide;
+ Current_Position := Editor.Get_Insert_Position;
+ if Buffer.Search_Forward (Current_Position, Item, Found_At, Match_Case) then
+ Buffer.Set_Selection (Found_At, Found_At + Item'Length);
+ Editor.Set_Insert_Position (Found_At + Item'Length);
+ Editor.Show_Insert_Position;
+ else
+ Alert ("No occurrences of '" & Item & "' found!");
end if;
end Call;