Skip to content

Commit

Permalink
Adjusting document counter
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Sep 4, 2024
1 parent 2f5fd9a commit f9742b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 17 additions & 11 deletions bin/multi_file_view.ml
Original file line number Diff line number Diff line change
Expand Up @@ -318,24 +318,30 @@ 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"
index_of_document_selected
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;
Expand Down

0 comments on commit f9742b7

Please sign in to comment.