package matrix
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Fast, modern terminal toolkit for OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
mosaic-0.1.0.tbz
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/src/matrix.ansi/writer.ml.html
Source file writer.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34type t = { bytes : Bytes.t; cap : int; mutable pos : int } let make bytes = { bytes; cap = Bytes.length bytes; pos = 0 } let make_counting () = { bytes = Bytes.create 0; cap = 0; pos = 0 } let[@inline] len w = w.pos let[@inline] pos w = w.pos let[@inline] reset_pos w = w.pos <- 0 let slice w = Bytes.sub w.bytes 0 w.pos let[@inline] write_char w c = if w.cap = 0 then w.pos <- w.pos + 1 else ( if w.pos >= w.cap then invalid_arg "Writer: buffer overflow (char)"; Bytes.unsafe_set w.bytes w.pos c; w.pos <- w.pos + 1) let[@inline] write_string w s = let slen = String.length s in if slen = 0 then () else if w.cap = 0 then w.pos <- w.pos + slen else ( if w.pos + slen > w.cap then invalid_arg "Writer: buffer overflow (string)"; Bytes.blit_string s 0 w.bytes w.pos slen; w.pos <- w.pos + slen) let[@inline] write_subbytes w bytes off blen = if blen < 0 || off < 0 || off + blen > Bytes.length bytes then invalid_arg "Writer: invalid slice"; if blen = 0 then () else if w.cap = 0 then w.pos <- w.pos + blen else ( if w.pos + blen > w.cap then invalid_arg "Writer: buffer overflow (bytes)"; Bytes.blit bytes off w.bytes w.pos blen; w.pos <- w.pos + blen)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>