From 21990a0ac32a1f7f66acf60788c963a49f192c83 Mon Sep 17 00:00:00 2001 From: iain barnett Date: Mon, 5 Jul 2021 12:35:25 +0900 Subject: [PATCH] Position in the search now correctly updates in the prompt. I noticed that cycling through returned matches wasn't updating `@position`, so I've moved the prompt update (`search_prompt`) into `move_entry` because it wasn't being called consistently, while `update_results` also calls `move_entry`. fix: Prompt position in search wasn't updating, fixed. --- src/fancyline/widget/history_search.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fancyline/widget/history_search.cr b/src/fancyline/widget/history_search.cr index 39e6957..729b66f 100644 --- a/src/fancyline/widget/history_search.cr +++ b/src/fancyline/widget/history_search.cr @@ -79,7 +79,6 @@ class Fancyline end @position = 0 - editor.prompt = search_prompt move_entry ctx, -1 end @@ -110,6 +109,7 @@ class Fancyline ctx.editor.line = @matches[@position] ctx.editor.cursor = ctx.editor.line.size end + editor.prompt = search_prompt end end end