Skip to content

Commit

Permalink
Fixing single file view crash
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Sep 14, 2024
1 parent f9742b7 commit 204eb14
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 8.0.3

- Fixed single file view crash

## 8.0.2

- Reworked asynchronous search/filter UI code to avoid noticeable lag due to
Expand Down
43 changes: 22 additions & 21 deletions bin/single_file_view.ml
Original file line number Diff line number Diff line change
Expand Up @@ -331,24 +331,25 @@ let main : Nottui.ui Lwd.t =
let$* document_store =
Lwd.get Document_store_manager.single_file_view_document_store
in
let _, document_info =
Option.get (Document_store.min_binding document_store)
in
let$* bottom_pane = Bottom_pane.main ~document_info in
let bottom_pane_height = Nottui.Ui.layout_height bottom_pane in
let$* (term_width, term_height) = Lwd.get Ui_base.Vars.term_width_height in
let top_pane_height = term_height - bottom_pane_height in
let$* top_pane =
Top_pane.main
~width:term_width
~height:top_pane_height
~document_info
in
Nottui_widgets.vbox
[
Lwd.return (
Nottui.Ui.keyboard_area
(keyboard_handler ~document_info)
top_pane);
Lwd.return bottom_pane;
]
match Document_store.min_binding document_store with
| None -> Lwd.return (Nottui.Ui.atom (Notty.I.void 0 0))
| Some (_, document_info) -> (
let$* bottom_pane = Bottom_pane.main ~document_info in
let bottom_pane_height = Nottui.Ui.layout_height bottom_pane in
let$* (term_width, term_height) = Lwd.get Ui_base.Vars.term_width_height in
let top_pane_height = term_height - bottom_pane_height in
let$* top_pane =
Top_pane.main
~width:term_width
~height:top_pane_height
~document_info
in
Nottui_widgets.vbox
[
Lwd.return (
Nottui.Ui.keyboard_area
(keyboard_handler ~document_info)
top_pane);
Lwd.return bottom_pane;
]
)
2 changes: 1 addition & 1 deletion bin/version_string.ml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
let s = "8.0.2"
let s = "8.0.3"

0 comments on commit 204eb14

Please # to comment.