From f9742b7d6f793bb33f44e3fff68a7258163b97e2 Mon Sep 17 00:00:00 2001 From: Darren Li Date: Wed, 4 Sep 2024 23:59:12 +1000 Subject: [PATCH] Adjusting document counter --- CHANGELOG.md | 6 +++++- bin/multi_file_view.ml | 28 +++++++++++++++++----------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e3b0ea..c685400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,11 @@ - Previously there was still a lockstep somewhere that would prevent UI from progressing if previous search was still being cancelled - - The current implementation allows newest requests to override older requests entirely, and not wait for cancellations at all + - The current implementation allows newest requests to override older + requests entirely, and not wait for cancellations at all + +- Adjusted document counter in multi-file view to be visible even when no files + are listed ## 8.0.1 diff --git a/bin/multi_file_view.ml b/bin/multi_file_view.ml index 43506a4..5e691a2 100644 --- a/bin/multi_file_view.ml +++ b/bin/multi_file_view.ml @@ -318,16 +318,22 @@ module Bottom_pane = struct List.assoc input_mode Ui_base.Status_bar.input_mode_images in let content = - if document_count = 0 then - Nottui.Ui.atom input_mode_image - else ( - let file_shown_count = - Notty.I.strf ~attr:Ui_base.Status_bar.attr - "%5d/%d documents listed" - document_count - (Document_store.size - (Lwd.peek Document_store_manager.multi_file_view_document_store)) - in + let file_shown_count = + Notty.I.strf ~attr:Ui_base.Status_bar.attr + "%5d/%d documents listed" + document_count + (Document_store.size + (Lwd.peek Document_store_manager.multi_file_view_document_store)) + in + if document_count = 0 then ( + Notty.I.hcat + [ + input_mode_image; + Ui_base.Status_bar.element_spacer; + file_shown_count; + ] + |> Nottui.Ui.atom + ) else ( let index_of_selected = Notty.I.strf ~attr:Ui_base.Status_bar.attr "Index of document selected: %d" @@ -335,7 +341,7 @@ module Bottom_pane = struct in Notty.I.hcat [ - List.assoc input_mode Ui_base.Status_bar.input_mode_images; + input_mode_image; Ui_base.Status_bar.element_spacer; file_shown_count; Ui_base.Status_bar.element_spacer;