<pre><span id="VALis_eol"><span class="keyword">val</span> is_eol</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> bool</code></pre>
<pre><span id="VALmove_till"><span class="keyword">val</span> move_till</span> : <code class="type">int -> (<a href="Rope.html#TYPEt">t</a> -> int -> bool) -> <a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
<pre><span id="VALto_bol"><span class="keyword">val</span> to_bol</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
-<pre><span id="VALto_eol"><span class="keyword">val</span> to_eol</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre></body></html>
\ No newline at end of file
+<pre><span id="VALto_eol"><span class="keyword">val</span> to_eol</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
+<pre><span id="VALnextln"><span class="keyword">val</span> nextln</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
+<pre><span id="VALprevln"><span class="keyword">val</span> prevln</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre></body></html>
\ No newline at end of file
<td></td></tr>
<tr><td><a href="Rope.html#VALnextc">nextc</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
+<tr><td><a href="Rope.html#VALnextln">nextln</a> [<a href="Rope.html">Rope</a>]</td>
+<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALnormal">normal</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALnumber">number</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALprevc">prevc</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
+<tr><td><a href="Rope.html#VALprevln">prevln</a> [<a href="Rope.html">Rope</a>]</td>
+<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALprocedure">procedure</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
<tr><td><a href="X11.html#VALprop_get">prop_get</a> [<a href="X11.html">X11</a>]</td>
let nh = 1 + lh + rh in
Node (left, right, nh, llen + rlen)
-(*
- let n = Node (left, right, nh, llen + rlen) in
- match (lh - rh) with
- | 0 -> n
- | 1 -> n
- | -1 -> n
-*)
-
let rec split rope i =
if i < 0 || i > (length rope) then
raise (Out_of_bounds "Rope.split");
let to_eol rope pos =
move_till (+1) is_eol rope pos
+
+(******************************************************************************)
+
+let nextln rope pos =
+ nextc rope (to_eol rope pos)
+
+let prevln rope pos =
+ prevc rope (to_bol rope pos)
val nextc : rope -> int -> int
val prevc : rope -> int -> int
+val nextln : rope -> int -> int
+val prevln : rope -> int -> int
val is_bol : rope -> int -> bool
val is_eol : rope -> int -> bool
let bol = (Rope.to_bol (Buf.rope buf) off) in
let lines = ref [bol] in
let process_glyph i c =
- let is_eol = (Rope.is_eol (Buf.rope buf) i) in
- if (Draw.Cursor.next_glyph csr c) && is_eol == false then
+ let not_eol = ((Rope.is_eol (Buf.rope buf) i) == false) in
+ if (Draw.Cursor.next_glyph csr c) && not_eol then
lines := i :: !lines;
- (is_eol == false)
+ not_eol
in
Buf.iteri_from process_glyph buf off;
let lines = (Array.of_list (List.rev !lines)) in
let first map =
map.lines.(map.index)
-let bopl buf off =
- let rope = (Buf.rope buf) in
- Rope.prevc rope (Rope.to_bol rope off)
+let bopl buf off = (Rope.prevln (Buf.rope buf) off)
-let bonl buf off =
- let rope = (Buf.rope buf) in
- Rope.nextc rope (Rope.to_eol rope off)
+let bonl buf off = (Rope.nextln (Buf.rope buf) off)
let scroll_up map buf =
let next = map.index - 1 in