From 9a5453aa190834b01e78cd971c445f1f0e34ee41 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 28 Dec 2024 14:13:47 +0530 Subject: Add update flushing to allow showing loading state after showing window --- src/Chelleport/View.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Chelleport/View.hs') diff --git a/src/Chelleport/View.hs b/src/Chelleport/View.hs index 202c636..790b3f7 100644 --- a/src/Chelleport/View.hs +++ b/src/Chelleport/View.hs @@ -19,8 +19,11 @@ getSearchText :: State -> String getSearchText state = case stateMode state of ModeHints -> "" ModeSearch {searchInputText, searchFilteredWords, searchHighlightedIndex} -> - "Searching (" ++ matchCount ++ "): " ++ searchInputText + searchText where + searchText + | stateIsModeInitialized state = "Searching (" ++ matchCount ++ "): " ++ searchInputText + | otherwise = "Loading..." matchCount | isEmpty searchFilteredWords = "0/0" | otherwise = show (searchHighlightedIndex + 1) ++ "/" ++ show (length searchFilteredWords) -- cgit v1.3.1