buffer#create_mark ~name:"locked" ~left_gravity:true buffer#start_iter
val locked_tag = buffer#create_tag [`BACKGROUND "lightblue"; `EDITABLE false]
buffer#create_mark ~name:"locked" ~left_gravity:true buffer#start_iter
val locked_tag = buffer#create_tag [`BACKGROUND "lightblue"; `EDITABLE false]
(* history can't be empty, the invariant above grant that it contains at
* least the init status *)
method status = match history with hd :: _ -> hd | _ -> assert false
(* history can't be empty, the invariant above grant that it contains at
* least the init status *)
method status = match history with hd :: _ -> hd | _ -> assert false
- let locked_iter () = buffer#get_iter_at_mark (`NAME "locked") in
- let cursor_iter = buffer#get_iter_at_mark `INSERT in
- let cmp = (locked_iter ())#offset - cursor_iter#offset in
+ let locked_offset () =
+ (buffer#get_iter_at_mark (`NAME "locked"))#offset in
+ let cursor_offset () = (buffer#get_iter_at_mark `INSERT)#offset in
+ let cmp = (locked_offset ()) - cursor_offset () in