stitch

Note taking for messy minimalists

git clone git://mccd.space/stitch

compontent.ml (587B)

      1 open Notty
      2 
      3 let current_line size_x y scroll (el : Grep.display_type) i =
      4   match el with
      5   | Bold el ->
      6     if i == y - scroll
      7     then (
      8       let fill = String.make (max (size_x - String.length el) 0) ' ' in
      9       I.strf "%s%s" ~attr:A.(st bold ++ st reverse) el fill |> I.pad ~l:0 ~t:i)
     10     else I.strf "%s" ~attr:A.(st bold) el |> I.pad ~l:0 ~t:i
     11   | Normal el ->
     12     if i == y - scroll
     13     then (
     14       let fill = String.make (max (size_x - String.length el) 0) ' ' in
     15       I.strf "%s%s" ~attr:A.(st reverse) el fill |> I.pad ~l:0 ~t:i)
     16     else I.strf "%s" el |> I.pad ~l:0 ~t:i