Browse Source

fix: avoid unicode problems in unfoldable

nottui-full-sensor
Simon Cruanes 11 months ago
committed by Frédéric Bour
parent
commit
417dbd6cd6
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lib/nottui-widgets/nottui_widgets.ml

+ 3
- 3
lib/nottui-widgets/nottui_widgets.ml 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


Loading…
Cancel
Save