fix: avoid unicode problems in unfoldable

This commit is contained in:
Simon Cruanes 2020-06-05 15:10:03 -04:00 committed by Frédéric Bour
parent a24e7f421c
commit 417dbd6cd6
1 changed files with 3 additions and 3 deletions

View File

@ -419,9 +419,9 @@ let unfoldable ?(folded_by_default=true) summary (f: unit -> Ui.t Lwd.t) : Ui.t
in
(* pad summary with a "> " when it's opened *)
let summary =
Lwd.get opened >>= function
| true -> Lwd.map (Ui.join_x (string "🔽 ")) summary
| false -> Lwd.map (Ui.join_x (string "▶️ ")) summary
Lwd.get opened >>= fun op ->
summary >|= fun s ->
Ui.hcat [string ~attr:A.(bg blue) (if op then "v" else ">"); string " "; s]
in
let cursor ~x:_ ~y:_ = function
| `Left when Lwd.peek opened -> Lwd.set opened false; `Handled