let onfocus focused = ()
let onkeypress mods rune =
- edit_view := View.scroll_dn !edit_view
+ edit_view := View.scroll_up !edit_view
let onmousebtn mods btn x y pressed =
- match btn with
+ if pressed then match btn with
| 1 -> ()
| 2 -> ()
| 3 -> ()
let bol = (Rope.to_bol (Buf.rope buf) off) in
let lines = ref [bol] in
let process_glyph i c =
- if (Draw.Cursor.next_glyph csr c) then
+ let is_eol = (Rope.is_eol (Buf.rope buf) i) in
+ if (Draw.Cursor.next_glyph csr c) && is_eol == false then
lines := i :: !lines;
- ((Rope.is_eol (Buf.rope buf) i) == false)
+ (is_eol == false)
in
Buf.iteri_from process_glyph buf off;
let lines = (Array.of_list (List.rev !lines)) in