Skip to content

Commit

Permalink
Fixed releasing notty terminal too early
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Aug 9, 2023
1 parent cec2745 commit 34a7e3b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.1

- Fixed releasing Notty terminal too early

## 1.1.0

- Added index saving and loading
Expand Down
5 changes: 4 additions & 1 deletion bin/docfd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,13 @@ let run
| Ui_multi_file -> Multi_file_view.main
| Ui_single_file -> Single_file_view.main
in
let term = Ui_base.term () in
let rec loop () =
Ui_base.Vars.file_to_open := None;
Lwd.set Ui_base.Vars.quit false;
Ui_base.ui_loop
~quit:Ui_base.Vars.quit
~term
root;
match !Ui_base.Vars.file_to_open with
| None -> ()
Expand Down Expand Up @@ -263,7 +265,8 @@ let run
loop ()
)
in
loop ()
loop ();
Notty_unix.Term.release term
)

let files_arg = Arg.(value & pos_all string [ "." ] & info [])
Expand Down
6 changes: 2 additions & 4 deletions bin/ui_base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,8 @@ module Search_bar = struct
]
end

let ui_loop ~quit root =
let ui_loop ~quit ~term root =
let renderer = Nottui.Renderer.make () in
let term = term () in
let root =
let$ root = root in
root
Expand All @@ -351,5 +350,4 @@ let ui_loop ~quit root =
loop ()
)
in
loop ();
Notty_unix.Term.release term
loop ()
2 changes: 1 addition & 1 deletion bin/version_string.ml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
let s = "1.1.0"
let s = "1.1.1"

0 comments on commit 34a7e3b

Please sign in to comment.