Draw.status csr "UNSI> *scratch*";
Draw.tags csr !tags_buf;
Draw.scroll csr;
- Draw.edit csr !edit_buf
+ Draw.edit csr !edit_buf;
+ let _ = Scrollmap.make !edit_buf width height 0 in ()
let onshutdown () = ()
let iter_from fn buf i =
Rope.iter_from fn buf.rope i
+let iteri_from fn buf i =
+ Rope.iteri_from fn buf.rope i
+
(* Unit Tests *****************************************************************)
let run_unit_tests () =
map : int array
}
-let make buf =
- let bol = (Rope.to_bol (Buf.rope buf) (Buf.start buf)) in
+let make buf width height off =
+ let bol = (Rope.to_bol (Buf.rope buf) off) in
+ let lines = ref [bol] in
+ let csr = Draw.Cursor.make (width, 0) 0 0 in
+ let process_glyph i c =
+ let open Draw.Cursor in
+ next_glyph csr c false;
+ (*if csr.startx == csr.x then
+ lines := i :: !lines;*)
+ ((Rope.is_eol (Buf.rope buf) i) == false)
+ in
+ Buf.iteri_from process_glyph buf off;
+ List.iter (fun n -> Printf.printf "%d " n) !lines;
+ print_endline "";
{ index = 0; map = [||] }
-(* Unit Tests** ***************************************************************)
+(* Unit Tests *****************************************************************)
let run_unit_tests () = ()