</div>
<h1>Module <a href="type_Buf.Cursor.html">Buf.Cursor</a></h1>
-<pre><span class="keyword">module</span> Cursor: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULECursor"><span class="keyword">module</span> Cursor</span>: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><code><span id="TYPEcsr"><span class="keyword">type</span> <code class="type"></code>csr</span> = {</code></pre><table class="typetable">
<tr>
</div>
<h1>Module <a href="type_Buf.html">Buf</a></h1>
-<pre><span class="keyword">module</span> Buf: <code class="code">sig</code> <a href="Buf.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEBuf"><span class="keyword">module</span> Buf</span>: <code class="code">sig</code> <a href="Buf.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><code><span id="TYPEbuf"><span class="keyword">type</span> <code class="type"></code>buf</span> = {</code></pre><table class="typetable">
<tr>
<pre><span id="VALlength"><span class="keyword">val</span> length</span> : <code class="type"><a href="Buf.html#TYPEbuf">buf</a> -> int</code></pre>
<pre><span id="VALiteri"><span class="keyword">val</span> iteri</span> : <code class="type">(int -> <a href="Rope.html#TYPErune">Rope.rune</a> -> bool) -> <a href="Buf.html#TYPEbuf">buf</a> -> int -> unit</code></pre>
<pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">(<a href="Rope.html#TYPErune">Rope.rune</a> -> bool) -> <a href="Buf.html#TYPEbuf">buf</a> -> int -> unit</code></pre>
-<pre><span class="keyword">module</span> <a href="Buf.Cursor.html">Cursor</a>: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre>
+<pre><span id="MODULECursor"><span class="keyword">module</span> <a href="Buf.Cursor.html">Cursor</a></span>: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre>
<pre><span id="VALmove_to"><span class="keyword">val</span> move_to</span> : <code class="type"><a href="Buf.html#TYPEdest">dest</a> -> <a href="Buf.html#TYPEbuf">buf</a> -> int -> int</code></pre>
<pre><span id="VALnextc"><span class="keyword">val</span> nextc</span> : <code class="type"><a href="Buf.html#TYPEbuf">buf</a> -> int -> int</code></pre>
<pre><span id="VALprevc"><span class="keyword">val</span> prevc</span> : <code class="type"><a href="Buf.html#TYPEbuf">buf</a> -> int -> int</code></pre>
</div>
<h1>Module <a href="type_Cfg.Color.Syntax.html">Cfg.Color.Syntax</a></h1>
-<pre><span class="keyword">module</span> Syntax: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULESyntax"><span class="keyword">module</span> Syntax</span>: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="VALnormal"><span class="keyword">val</span> normal</span> : <code class="type">int</code></pre>
<pre><span id="VALcomment"><span class="keyword">val</span> comment</span> : <code class="type">int</code></pre>
</div>
<h1>Module <a href="type_Cfg.Color.html">Cfg.Color</a></h1>
-<pre><span class="keyword">module</span> Color: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEColor"><span class="keyword">module</span> Color</span>: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="VALpalette"><span class="keyword">val</span> palette</span> : <code class="type">int array</code></pre>
<pre><span id="VALscroll_nor"><span class="keyword">val</span> scroll_nor</span> : <code class="type">int * int</code></pre>
<pre><span id="VALedit_csr"><span class="keyword">val</span> edit_csr</span> : <code class="type">int</code></pre>
<pre><span id="VALedit_rul"><span class="keyword">val</span> edit_rul</span> : <code class="type">int</code></pre>
<pre><span id="VALborders"><span class="keyword">val</span> borders</span> : <code class="type">int * int</code></pre>
-<pre><span class="keyword">module</span> <a href="Cfg.Color.Syntax.html">Syntax</a>: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
+<pre><span id="MODULESyntax"><span class="keyword">module</span> <a href="Cfg.Color.Syntax.html">Syntax</a></span>: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
</div>
<h1>Module <a href="type_Cfg.html">Cfg</a></h1>
-<pre><span class="keyword">module</span> Cfg: <code class="code">sig</code> <a href="Cfg.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULECfg"><span class="keyword">module</span> Cfg</span>: <code class="code">sig</code> <a href="Cfg.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="VALboolvar"><span class="keyword">val</span> boolvar</span> : <code class="type">string -> bool -> bool</code></pre>
<pre><span id="VALintvar"><span class="keyword">val</span> intvar</span> : <code class="type">string -> int -> int</code></pre>
<pre><span id="VALscroll_lines"><span class="keyword">val</span> scroll_lines</span> : <code class="type">int</code></pre>
<pre><span id="VALdbl_click_time"><span class="keyword">val</span> dbl_click_time</span> : <code class="type">int</code></pre>
<pre><span id="VALmax_scan_dist"><span class="keyword">val</span> max_scan_dist</span> : <code class="type">int</code></pre>
-<pre><span class="keyword">module</span> <a href="Cfg.Color.html">Color</a>: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
+<pre><span id="MODULEColor"><span class="keyword">module</span> <a href="Cfg.Color.html">Color</a></span>: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
</div>
<h1>Module <a href="type_Draw.Cursor.html">Draw.Cursor</a></h1>
-<pre><span class="keyword">module</span> Cursor: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULECursor"><span class="keyword">module</span> Cursor</span>: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><code><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = {</code></pre><table class="typetable">
<tr>
</div>
<h1>Module <a href="type_Draw.html">Draw</a></h1>
-<pre><span class="keyword">module</span> Draw: <code class="code">sig</code> <a href="Draw.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEDraw"><span class="keyword">module</span> Draw</span>: <code class="code">sig</code> <a href="Draw.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="VALfont"><span class="keyword">val</span> font</span> : <code class="type"><a href="X11.html#TYPEfont">X11.font</a></code></pre>
<pre><span id="VALfont_height"><span class="keyword">val</span> font_height</span> : <code class="type">int</code></pre>
<pre><span id="VALtabglyph"><span class="keyword">val</span> tabglyph</span> : <code class="type">int</code></pre>
<pre><span id="VALtabwidth"><span class="keyword">val</span> tabwidth</span> : <code class="type">int</code></pre>
<pre><span id="VALglyph_width"><span class="keyword">val</span> glyph_width</span> : <code class="type"><a href="X11.html#TYPEglyph">X11.glyph</a> -> int</code></pre>
-<pre><span class="keyword">module</span> <a href="Draw.Cursor.html">Cursor</a>: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre>
+<pre><span id="MODULECursor"><span class="keyword">module</span> <a href="Draw.Cursor.html">Cursor</a></span>: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre>
<pre><span id="VALrectangle"><span class="keyword">val</span> rectangle</span> : <code class="type">int -> int -> int -> <a href="Draw.Cursor.html#TYPEt">Cursor.t</a> -> unit</code></pre>
<pre><span id="VALdark_bkg"><span class="keyword">val</span> dark_bkg</span> : <code class="type">int -> int -> <a href="Draw.Cursor.html#TYPEt">Cursor.t</a> -> unit</code></pre>
<pre><span id="VALlight_bkg"><span class="keyword">val</span> light_bkg</span> : <code class="type">int -> int -> <a href="Draw.Cursor.html#TYPEt">Cursor.t</a> -> unit</code></pre>
</div>
<h1>Module <a href="type_Misc.html">Misc</a></h1>
-<pre><span class="keyword">module</span> Misc: <code class="code">sig</code> <a href="Misc.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEMisc"><span class="keyword">module</span> Misc</span>: <code class="code">sig</code> <a href="Misc.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="VALload_file"><span class="keyword">val</span> load_file</span> : <code class="type">string -> string</code></pre></body></html>
\ No newline at end of file
</div>
<h1>Module <a href="type_Rope.html">Rope</a></h1>
-<pre><span class="keyword">module</span> Rope: <code class="code">sig</code> <a href="Rope.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULERope"><span class="keyword">module</span> Rope</span>: <code class="code">sig</code> <a href="Rope.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="EXCEPTIONOut_of_bounds"><span class="keyword">exception</span> Out_of_bounds</span> <span class="keyword">of</span> <code class="type">string</code></pre>
<pre><span id="VALis_leaf"><span class="keyword">val</span> is_leaf</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> bool</code></pre>
<pre><span id="VALlimit_index"><span class="keyword">val</span> limit_index</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
<pre><span id="VALlast"><span class="keyword">val</span> last</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int</code></pre>
-<pre><span id="VALcheck_index"><span class="keyword">val</span> check_index</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> unit</code></pre>
-<pre><span id="VALgetb"><span class="keyword">val</span> getb</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> char</code></pre>
<pre><span id="VALgetc"><span class="keyword">val</span> getc</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
<pre><span id="VALiteri"><span class="keyword">val</span> iteri</span> : <code class="type">(int -> int -> bool) -> <a href="Rope.html#TYPEt">t</a> -> int -> unit</code></pre>
<pre><span id="VALgets"><span class="keyword">val</span> gets</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int -> string</code></pre>
+<pre><span id="VALto_string"><span class="keyword">val</span> to_string</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> string</code></pre>
<pre><span id="VALflatten"><span class="keyword">val</span> flatten</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a></code></pre>
<pre><span id="VALjoin"><span class="keyword">val</span> join</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a></code></pre>
<pre><span id="VALjoin_special"><span class="keyword">val</span> join_special</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a></code></pre>
</div>
<h1>Module <a href="type_Scrollmap.html">Scrollmap</a></h1>
-<pre><span class="keyword">module</span> Scrollmap: <code class="code">sig</code> <a href="Scrollmap.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEScrollmap"><span class="keyword">module</span> Scrollmap</span>: <code class="code">sig</code> <a href="Scrollmap.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><code><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = {</code></pre><table class="typetable">
<tr>
</div>
<h1>Module <a href="type_View.html">View</a></h1>
-<pre><span class="keyword">module</span> View: <code class="code">sig</code> <a href="View.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEView"><span class="keyword">module</span> View</span>: <code class="code">sig</code> <a href="View.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><code><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = {</code></pre><table class="typetable">
<tr>
</div>
<h1>Module <a href="type_X11.GlyphMap.html">X11.GlyphMap</a></h1>
-<pre><span class="keyword">module</span> GlyphMap: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre><hr width="100%">
+<pre><span id="MODULEGlyphMap"><span class="keyword">module</span> GlyphMap</span>: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre><hr width="100%">
</body></html>
\ No newline at end of file
</div>
<h1>Module <a href="type_X11.Rune.html">X11.Rune</a></h1>
-<pre><span class="keyword">module</span> Rune: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULERune"><span class="keyword">module</span> Rune</span>: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type">int</code> </pre>
</div>
<h1>Module <a href="type_X11.html">X11</a></h1>
-<pre><span class="keyword">module</span> X11: <code class="code">sig</code> <a href="X11.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEX11"><span class="keyword">module</span> X11</span>: <code class="code">sig</code> <a href="X11.html">..</a> <code class="code">end</code></pre><hr width="100%">
<pre><span id="TYPExatom"><span class="keyword">type</span> <code class="type"></code>xatom</span> </pre>
-<pre><span class="keyword">module</span> <a href="X11.Rune.html">Rune</a>: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre>
-<pre><span class="keyword">module</span> <a href="X11.GlyphMap.html">GlyphMap</a>: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre>
+<pre><span id="MODULERune"><span class="keyword">module</span> <a href="X11.Rune.html">Rune</a></span>: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre>
+<pre><span id="MODULEGlyphMap"><span class="keyword">module</span> <a href="X11.GlyphMap.html">GlyphMap</a></span>: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre>
<pre><span id="VALconnect"><span class="keyword">val</span> connect</span> : <code class="type">unit -> unit</code></pre>
<pre><span id="VALdisconnect"><span class="keyword">val</span> disconnect</span> : <code class="type">unit -> unit</code></pre>
<pre><span id="VALmake_window"><span class="keyword">val</span> make_window</span> : <code class="type">int -> int -> <a href="X11.html#TYPExwin">xwin</a></code></pre>
<link title="View" rel="Chapter" href="View.html"><title></title>
</head>
<body>
-<h1></h1>
+<div class = "index-list">
<ul class="indexlist">
<li><a href="index_types.html">Index of types</a></li>
<li><a href="index_exceptions.html">Index of exceptions</a></li>
<li><a href="index_values.html">Index of values</a></li>
<li><a href="index_modules.html">Index of modules</a></li>
</ul>
-<br/><br>
-<table class="indextable">
+</div>
+
+<table class="indextable module-list">
<tr><td class="module"><a href="Misc.html">Misc</a></td><td></td></tr>
<tr><td class="module"><a href="X11.html">X11</a></td><td></td></tr>
<tr><td class="module"><a href="Cfg.html">Cfg</a></td><td></td></tr>
</div>
<h1>Index of exceptions</h1>
<table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
<tr><td><a href="Rope.html#EXCEPTIONBad_rotation">Bad_rotation</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>O</td></tr>
+<tr><td align="left"><div>O</div></td></tr>
<tr><td><a href="Rope.html#EXCEPTIONOut_of_bounds">Out_of_bounds</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
</table>
</div>
<h1>Index of modules</h1>
<table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
<tr><td><a href="Buf.html">Buf</a> </td>
<td></td></tr>
-<tr><td align="left"><br>C</td></tr>
+<tr><td align="left"><div>C</div></td></tr>
<tr><td><a href="Cfg.html">Cfg</a> </td>
<td></td></tr>
<tr><td><a href="Cfg.Color.html">Color</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
<tr><td><a href="Buf.Cursor.html">Cursor</a> [<a href="Buf.html">Buf</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>D</td></tr>
+<tr><td align="left"><div>D</div></td></tr>
<tr><td><a href="Draw.html">Draw</a> </td>
<td></td></tr>
-<tr><td align="left"><br>G</td></tr>
+<tr><td align="left"><div>G</div></td></tr>
<tr><td><a href="X11.GlyphMap.html">GlyphMap</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>M</td></tr>
+<tr><td align="left"><div>M</div></td></tr>
<tr><td><a href="Misc.html">Misc</a> </td>
<td></td></tr>
-<tr><td align="left"><br>R</td></tr>
+<tr><td align="left"><div>R</div></td></tr>
<tr><td><a href="Rope.html">Rope</a> </td>
<td></td></tr>
<tr><td><a href="X11.Rune.html">Rune</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>S</td></tr>
+<tr><td align="left"><div>S</div></td></tr>
<tr><td><a href="Scrollmap.html">Scrollmap</a> </td>
<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html">Syntax</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>V</td></tr>
+<tr><td align="left"><div>V</div></td></tr>
<tr><td><a href="View.html">View</a> </td>
<td></td></tr>
-<tr><td align="left"><br>X</td></tr>
+<tr><td align="left"><div>X</div></td></tr>
<tr><td><a href="X11.html">X11</a> </td>
<td></td></tr>
</table>
</div>
<h1>Index of types</h1>
<table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
<tr><td><a href="Buf.html#TYPEbuf">buf</a> [<a href="Buf.html">Buf</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>C</td></tr>
+<tr><td align="left"><div>C</div></td></tr>
<tr><td><a href="Buf.Cursor.html#TYPEcsr">csr</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>D</td></tr>
+<tr><td align="left"><div>D</div></td></tr>
<tr><td><a href="Buf.html#TYPEdest">dest</a> [<a href="Buf.html">Buf</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>F</td></tr>
+<tr><td align="left"><div>F</div></td></tr>
<tr><td><a href="X11.html#TYPEfont">font</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>G</td></tr>
+<tr><td align="left"><div>G</div></td></tr>
<tr><td><a href="X11.html#TYPEglyph">glyph</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>R</td></tr>
+<tr><td align="left"><div>R</div></td></tr>
<tr><td><a href="Rope.html#TYPErope">rope</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#TYPErune">rune</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>T</td></tr>
+<tr><td align="left"><div>T</div></td></tr>
<tr><td><a href="View.html#TYPEt">t</a> [<a href="View.html">View</a>]</td>
<td></td></tr>
<tr><td><a href="Scrollmap.html#TYPEt">t</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
<td></td></tr>
<tr><td><a href="X11.Rune.html#TYPEt">t</a> [<a href="X11.Rune.html">X11.Rune</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>X</td></tr>
+<tr><td align="left"><div>X</div></td></tr>
<tr><td><a href="X11.html#TYPExatom">xatom</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
<tr><td><a href="X11.html#TYPExcfgvar">xcfgvar</a> [<a href="X11.html">X11</a>]</td>
</div>
<h1>Index of values</h1>
<table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
<tr><td><a href="Buf.Cursor.html#VALbol">bol</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
<td></td></tr>
<tr><td><a href="Buf.html#VALbol">bol</a> [<a href="Buf.html">Buf</a>]</td>
<td></td></tr>
<tr><td><a href="Draw.html#VALbuffer">buffer</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>C</td></tr>
+<tr><td align="left"><div>C</div></td></tr>
<tr><td><a href="X11.html#VALcache_update">cache_update</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALchar">char</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
-<tr><td><a href="Rope.html#VALcheck_index">check_index</a> [<a href="Rope.html">Rope</a>]</td>
-<td></td></tr>
<tr><td><a href="Draw.Cursor.html#VALclone">clone</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
<td></td></tr>
<tr><td><a href="Buf.Cursor.html#VALclone">clone</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.html#VALcopy_indent">copy_indent</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>D</td></tr>
+<tr><td align="left"><div>D</div></td></tr>
<tr><td><a href="Draw.html#VALdark_bkg">dark_bkg</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.html#VALdbl_click_time">dbl_click_time</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
<tr><td><a href="Draw.Cursor.html#VALdraw_tab">draw_tab</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>E</td></tr>
+<tr><td align="left"><div>E</div></td></tr>
<tr><td><a href="Draw.html#VALedit">edit</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.Color.html#VALedit_csr">edit_csr</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.html#VALexpand_tabs">expand_tabs</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>F</td></tr>
+<tr><td align="left"><div>F</div></td></tr>
<tr><td><a href="Scrollmap.html#VALfind_line">find_line</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
<td></td></tr>
<tr><td><a href="Scrollmap.html#VALfirst">first</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALfrom_string">from_string</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>G</td></tr>
+<tr><td align="left"><div>G</div></td></tr>
<tr><td><a href="X11.html#VALget_glyph">get_glyph</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
-<tr><td><a href="Rope.html#VALgetb">getb</a> [<a href="Rope.html">Rope</a>]</td>
-<td></td></tr>
<tr><td><a href="Buf.Cursor.html#VALgetc">getc</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALgetc">getc</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.Color.html#VALgutter_sel">gutter_sel</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>H</td></tr>
+<tr><td align="left"><div>H</div></td></tr>
<tr><td><a href="Draw.Cursor.html#VALhas_next_line">has_next_line</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALheight">height</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
<tr><td><a href="Draw.html#VALhrule">hrule</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>I</td></tr>
+<tr><td align="left"><div>I</div></td></tr>
<tr><td><a href="X11.html#VALintern">intern</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.html#VALintvar">intvar</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALiteri">iteri</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>J</td></tr>
+<tr><td align="left"><div>J</div></td></tr>
<tr><td><a href="Rope.html#VALjoin">join</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALjoin_special">join_special</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>K</td></tr>
+<tr><td align="left"><div>K</div></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALkeyword">keyword</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>L</td></tr>
+<tr><td align="left"><div>L</div></td></tr>
<tr><td><a href="Rope.html#VALlast">last</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
<tr><td><a href="Buf.html#VALlength">length</a> [<a href="Buf.html">Buf</a>]</td>
<td></td></tr>
<tr><td><a href="Misc.html#VALload_file">load_file</a> [<a href="Misc.html">Misc</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>M</td></tr>
+<tr><td align="left"><div>M</div></td></tr>
<tr><td><a href="View.html#VALmake">make</a> [<a href="View.html">View</a>]</td>
<td></td></tr>
<tr><td><a href="Scrollmap.html#VALmake">make</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
<td></td></tr>
<tr><td><a href="Draw.Cursor.html#VALmove_x">move_x</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>N</td></tr>
+<tr><td align="left"><div>N</div></td></tr>
<tr><td><a href="Draw.Cursor.html#VALnext_glyph">next_glyph</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
<td></td></tr>
<tr><td><a href="Draw.Cursor.html#VALnext_line">next_line</a> [<a href="Draw.Cursor.html">Draw.Cursor</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 align="left"><br>O</td></tr>
+<tr><td align="left"><div>O</div></td></tr>
<tr><td><a href="Buf.Cursor.html#VALoffset">offset</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALoperator">operator</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>P</td></tr>
+<tr><td align="left"><div>P</div></td></tr>
<tr><td><a href="Cfg.Color.html#VALpalette">palette</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
<td></td></tr>
<tr><td><a href="View.html#VALpath">path</a> [<a href="View.html">View</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALputs">puts</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>R</td></tr>
+<tr><td align="left"><div>R</div></td></tr>
<tr><td><a href="Draw.html#VALrectangle">rectangle</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
<tr><td><a href="View.html#VALresize">resize</a> [<a href="View.html">View</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.html#VALruler_column">ruler_column</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>S</td></tr>
+<tr><td align="left"><div>S</div></td></tr>
<tr><td><a href="Draw.html#VALscroll">scroll</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
<tr><td><a href="View.html#VALscroll_dn">scroll_dn</a> [<a href="View.html">View</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.html#VALsyntax_enabled">syntax_enabled</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>T</td></tr>
+<tr><td align="left"><div>T</div></td></tr>
<tr><td><a href="Cfg.html#VALtab_width">tab_width</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
<tr><td><a href="Draw.html#VALtabglyph">tabglyph</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
<tr><td><a href="Rope.html#VALto_eol">to_eol</a> [<a href="Rope.html">Rope</a>]</td>
<td></td></tr>
+<tr><td><a href="Rope.html#VALto_string">to_string</a> [<a href="Rope.html">Rope</a>]</td>
+<td></td></tr>
<tr><td><a href="Cfg.html#VALtrim_on_save">trim_on_save</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALtypedef">typedef</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>V</td></tr>
+<tr><td align="left"><div>V</div></td></tr>
<tr><td><a href="X11.html#VALvar_get">var_get</a> [<a href="X11.html">X11</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.Color.Syntax.html#VALvariable">variable</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
<td></td></tr>
<tr><td><a href="Draw.html#VALvrule">vrule</a> [<a href="Draw.html">Draw</a>]</td>
<td></td></tr>
-<tr><td align="left"><br>W</td></tr>
+<tr><td align="left"><div>W</div></td></tr>
<tr><td><a href="Cfg.html#VALwinheight">winheight</a> [<a href="Cfg.html">Cfg</a>]</td>
<td></td></tr>
<tr><td><a href="Cfg.html#VALwinwidth">winwidth</a> [<a href="Cfg.html">Cfg</a>]</td>
<span class="keyword">val</span> is_empty : <span class="keywordsign">'</span>a t <span class="keywordsign">-></span> bool<br>
<span class="keyword">val</span> mem : key <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t <span class="keywordsign">-></span> bool<br>
<span class="keyword">val</span> add : key <span class="keywordsign">-></span> <span class="keywordsign">'</span>a <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t<br>
+ <span class="keyword">val</span> update : key <span class="keywordsign">-></span> (<span class="keywordsign">'</span>a option <span class="keywordsign">-></span> <span class="keywordsign">'</span>a option) <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t<br>
<span class="keyword">val</span> singleton : key <span class="keywordsign">-></span> <span class="keywordsign">'</span>a <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t<br>
<span class="keyword">val</span> remove : key <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t <span class="keywordsign">-></span> <span class="keywordsign">'</span>a t<br>
<span class="keyword">val</span> merge :<br>
let last rope =
limit_index rope ((length rope) - 1)
-let check_index rope i =
- if i < 0 || i >= (length rope) then begin
- raise (Out_of_bounds "Rope.check_index")
- end
-
-let rec getb rope i =
- check_index rope i;
- match rope with
- | Leaf (s,off,_) ->
- s.[off + i]
- | Node (l,r,h,len) ->
- let left_len = (length l) in
- if i < left_len then
- getb l i
- else
- getb r (i - left_len)
-
let rec getc rope i =
- check_index rope i;
match rope with
- | Leaf (s,off,_) -> (Char.code s.[off + i])
-(*
- let c = (Char.code s.[off + i]) in
- let len = (length rope) in
- let next = (i + 1) in
- if (c == 0x0D && next < len && (getc rope next) == 0x0A) then
- 0x0A
- else
- c
-*)
+ | Leaf (s,off,_) ->
+ Char.code s.[off + i]
| Node (l,r,h,len) ->
let left_len = (length l) in
if i < left_len then
(* inefficient form of iteri *)
let rec iteri fn rope pos =
- if pos < (length rope) && (fn pos (Char.code (getb rope pos))) then
+ if pos < (length rope) && (fn pos (getc rope pos)) then
iteri fn rope (pos + 1)
(* More efficient form of iteri?
rope i;
Bytes.unsafe_to_string buf
+let to_string rope =
+ gets rope 0 (length rope)
+
(* Rebalancing Algorithm from the original paper on ropes:
* Height of leaf is 0
| _ -> node
let rec split rope i =
- if i < 0 || i > (length rope) then
- raise (Out_of_bounds "Rope.split");
match rope with
| Leaf (s,off,len) ->
(Leaf (s, off, i), Leaf (s, (off + i), len - (i)))
val empty : rope
val from_string : string -> rope
+val to_string : rope -> string
val length : rope -> int
val height : rope -> int
val iteri : (int -> rune -> bool) -> rope -> int -> unit
-val getb : rope -> int -> char
val getc : rope -> int -> rune
val putc : rope -> int -> rune -> rope
val gets : rope -> int -> int -> string
open Test
open Rope
-let () =
- (* length() tests *)
+let () = (* empty tests *)
+ test "empty : should be an empty rope" (fun () ->
+ let rope = Rope.empty in
+ assert( length rope == 0 );
+ assert( height rope == 0 );
+ assert( to_string rope = "" )
+ );
+ ()
+
+let () = (* length() tests *)
test "length : 0 for empty string" (fun () ->
let rope = Leaf("", 0, 0) in
assert( length rope == 0 )
let rope = (join (Leaf("a", 0, 1)) (Leaf("a", 0, 1))) in
assert( length rope == 2 )
);
+ ()
+
+let () = (* last() tests *)
+ test "last() : should return 0" (fun () ->
+ let rope = from_string "" in
+ assert( last rope == 0 );
+ );
+ test "last() : should return 0" (fun () ->
+ let rope = from_string "a" in
+ assert( last rope == 0 );
+ );
+ test "last() : should return 1" (fun () ->
+ let rope = from_string "ab" in
+ assert( last rope == 1 );
+ );
+ test "last() : should return 2" (fun () ->
+ let rope = from_string "abc" in
+ assert( last rope == 2 );
+ );
+ ()
- (* flatten() tests *)
+let () = (* flatten() tests *)
test "flatten : flatten a tree to a leaf" (fun () ->
let tree = Node (Leaf("a", 0, 1), Leaf("b", 0, 1), 2, 2) in
let leaf = (flatten tree) in
| Leaf ("ab",0,2) -> true
| _ -> false)
);
+ ()
- (* join() tests *)
+let () = (* join() tests *)
test "join : join two leaves into rope" (fun () ->
let left = Leaf("a", 0, 1) in
let right = Leaf("b", 0, 1) in
| Leaf ("abc",0,3) -> true
| _ -> false)
);
+ ()
- (* getc() tests *)
+let () = (* split() tests *)
+ test "split : split string into two parts" (fun () ->
+ let left, right = split (from_string "ab") 1 in
+ assert (to_string left = "a");
+ assert (to_string right = "b")
+ );
+ test "split : split string into empty left and full right" (fun () ->
+ let left, right = split (from_string "ab") 0 in
+ assert (to_string left = "");
+ assert (to_string right = "ab")
+ );
+ test "split : split string into empty right and full left" (fun () ->
+ let left, right = split (from_string "ab") 2 in
+ assert (to_string left = "ab");
+ assert (to_string right = "")
+ );
+ ()
+
+let () = (* getc() tests *)
test "getc : raise Out_of_bounds on negative index" (fun () ->
let rope = Leaf("a", 0, 1) in
try let _ = getc rope (-1) in assert false
- with Out_of_bounds _ -> assert true
+ with Invalid_argument _ -> assert true
);
test "getc : raise Out_of_bounds on out of bounds index" (fun () ->
let rope = Leaf("a", 0, 1) in
try let _ = getc rope (2) in assert false
- with Out_of_bounds _ -> assert true
+ with Invalid_argument _ -> assert true
);
test "getc : return index 0 of leaf" (fun () ->
let rope = Leaf("abc", 0, 3) in
let rope = Node((Leaf("a", 0, 1)), (Leaf("b", 0, 1)), 0, 2) in
assert( (getc rope (1)) == Char.code 'b' );
);
-(* test "getc : return \\n for \\r\\n" (fun () ->
- let rope = from_string "\r\n" in
- assert( (getc rope (0)) == Char.code '\n' );
- );
-*)
test "getc : return \\r for \\r at end of string" (fun () ->
let rope = from_string "\r" in
assert( (getc rope (0)) == Char.code '\r' );
let rope = from_string "\ra" in
assert( (getc rope (0)) == Char.code '\r' );
);
+ ()
- (* puts() tests *)
+let () = (* puts() tests *)
test "puts : insert at index 0" (fun () ->
let rope = Leaf("bc", 0, 2) in
let rope = (puts rope "a" 0) in
assert( (getc rope (1)) == Char.code 'b' );
assert( (getc rope (2)) == Char.code 'c' );
);
+ ()
- (* nextc() tests *)
+let () = (* nextc() tests *)
test "nextc : should return pos if at end of buffer" (fun () ->
let rope = Leaf("abc", 0, 3) in
assert( 2 == (nextc rope 2) );
let rope = Leaf("a\na", 0, 3) in
assert( 2 == (nextc rope 1) );
);
+ ()
- (* prevc() tests *)
+let () = (* prevc() tests *)
test "prevc : should return pos if at start of buffer" (fun () ->
let rope = Leaf("abc", 0, 3) in
assert( 0 == (prevc rope 0) );
let rope = Leaf("a\na", 0, 3) in
assert( 1 == (prevc rope 2) );
);
+ ()
- (* is_bol() tests *)
+let () = (* is_bol() tests *)
test "is_bol : should return true if pos is 0" (fun () ->
let rope = Leaf("abc", 0, 3) in
assert( is_bol rope 0 );
let rope = Leaf("\rabc", 0, 3) in
assert( (is_bol rope 1) == false );
);
+ ()
- (* is_eol() tests *)
+let () = (* is_eol() tests *)
test "is_eol : should return true if pos is Rope.last" (fun () ->
let rope = Leaf("abc", 0, 3) in
assert( is_eol rope 2 );
let rope = Leaf("abc\n", 0, 4) in
assert( is_eol rope 3 );
);
-(* test "is_eol : should return true if pos is last char of line with \\r\\n ending" (fun () ->
- let rope = Leaf("abc\r\n", 0, 5) in
- assert( is_eol rope 3 );
- );*)
test "is_eol : should return false if pos is not last char of line" (fun () ->
let rope = Leaf("abcd\n", 0, 5) in
assert( (is_eol rope 2) == false );
);
+ ()
- (* to_bol() tests *)
+let () = (* to_bol() tests *)
test "to_bol : should return index of first char on the line" (fun () ->
let rope = Leaf("\nabc\n", 0, 5) in
assert( (to_bol rope 2) == 1 );
);
()
+
+let () = (* to_eol() tests *)
+ test "to_bol : should return index of last char on the line" (fun () ->
+ let rope = Leaf("\nabc\n", 0, 5) in
+ assert( (to_eol rope 1) == 4 );
+ );
+ ()