fix: avoid unicode problems in unfoldable

This commit is contained in:
Simon Cruanes 2020-06-05 15:10:03 -04:00 提交者 Frédéric Bour
父節點 a24e7f421c
當前提交 417dbd6cd6
共有 1 個檔案被更改,包括 3 行新增3 行删除

查看文件

@ -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