mirror of
https://github.com/norcalli/nvim-colorizer.lua.git
synced 2026-09-10 07:06:14 -04:00
Update docs and luadocs
This commit is contained in:
parent
962453e7b7
commit
615e32c94f
|
|
@ -32,6 +32,7 @@
|
|||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="modules/colorizer.html">colorizer</a></li>
|
||||
<li><a href="modules/nvim.html">nvim</a></li>
|
||||
<li><a href="modules/trie.html">trie</a></li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -47,6 +48,10 @@
|
|||
<td class="name" nowrap><a href="modules/colorizer.html">colorizer</a></td>
|
||||
<td class="summary">Highlights terminal CSI ANSI color codes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/nvim.html">nvim</a></td>
|
||||
<td class="summary">Module of magic functions for nvim</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/trie.html">trie</a></td>
|
||||
<td class="summary">Trie implementation in luajit
|
||||
|
|
@ -58,7 +63,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2019-10-17 16:25:49 </i>
|
||||
<i style="float:right;">Last updated 2019-10-18 09:40:19 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><strong>colorizer</strong></li>
|
||||
<li><a href="../modules/nvim.html">nvim</a></li>
|
||||
<li><a href="../modules/trie.html">trie</a></li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -55,17 +56,29 @@
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#highlight_buffer">highlight_buffer (buf[, ns=DEFAULT_NAMESPACE], lines, line_start[, options])</a></td>
|
||||
<td class="name" nowrap><a href="#highlight_buffer">highlight_buffer (buf[, ns=DEFAULT_NAMESPACE], lines, line_start, options)</a></td>
|
||||
<td class="summary">Highlight the buffer region.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#attach_to_buffer">attach_to_buffer ([buf=0[, options]])</a></td>
|
||||
<td class="name" nowrap><a href="#attach_to_buffer">attach_to_buffer ([buf=0|nil[, options]])</a></td>
|
||||
<td class="summary">Attach to a buffer and continuously highlight changes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#detach_from_buffer">detach_from_buffer ([buf=0|nil[, ns=DEFAULT_NAMESPACE]])</a></td>
|
||||
<td class="summary">Stop highlighting the current buffer.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#setup">setup ([filetypes={'*'}[, default_options]])</a></td>
|
||||
<td class="summary">Easy to use function if you want the full setup without fine grained control.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#reload_all_buffers">reload_all_buffers ()</a></td>
|
||||
<td class="summary">Reload all of the currently active highlighted buffers.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_buffer_options">get_buffer_options ([buf=0|nil])</a></td>
|
||||
<td class="summary">Return the currently active buffer options.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
|
|
@ -84,7 +97,7 @@
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "highlight_buffer"></a>
|
||||
<strong>highlight_buffer (buf[, ns=DEFAULT_NAMESPACE], lines, line_start[, options])</strong>
|
||||
<strong>highlight_buffer (buf[, ns=DEFAULT_NAMESPACE], lines, line_start, options)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Highlight the buffer region.
|
||||
|
|
@ -114,7 +127,6 @@ buffer `buf` and attach it to the namespace `ns`.
|
|||
</li>
|
||||
<li><span class="parameter">options</span>
|
||||
Configuration options as described in `setup`
|
||||
(<em>optional</em>)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -129,7 +141,7 @@ buffer `buf` and attach it to the namespace `ns`.
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "attach_to_buffer"></a>
|
||||
<strong>attach_to_buffer ([buf=0[, options]])</strong>
|
||||
<strong>attach_to_buffer ([buf=0|nil[, options]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Attach to a buffer and continuously highlight changes.
|
||||
|
|
@ -140,7 +152,7 @@ buffer `buf` and attach it to the namespace `ns`.
|
|||
<li><span class="parameter">buf</span>
|
||||
<span class="types"><span class="type">integer</span></span>
|
||||
A value of 0 implies the current buffer.
|
||||
(<em>default</em> 0)
|
||||
(<em>default</em> 0|nil)
|
||||
</li>
|
||||
<li><span class="parameter">options</span>
|
||||
Configuration options as described in `setup`
|
||||
|
|
@ -156,6 +168,33 @@ buffer `buf` and attach it to the namespace `ns`.
|
|||
</ul>
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "detach_from_buffer"></a>
|
||||
<strong>detach_from_buffer ([buf=0|nil[, ns=DEFAULT_NAMESPACE]])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Stop highlighting the current buffer.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">buf</span>
|
||||
<span class="types"><span class="type">integer</span></span>
|
||||
A value of 0 or nil implies the current buffer.
|
||||
(<em>default</em> 0|nil)
|
||||
</li>
|
||||
<li><span class="parameter">ns</span>
|
||||
<span class="types"><span class="type">integer</span></span>
|
||||
the namespace id.
|
||||
(<em>default</em> DEFAULT_NAMESPACE)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "setup"></a>
|
||||
|
|
@ -198,6 +237,42 @@ buffer `buf` and attach it to the namespace `ns`.
|
|||
<pre class="example"><span class="global">require</span><span class="string">'colorizer'</span>.setup()</pre>
|
||||
</ul>
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "reload_all_buffers"></a>
|
||||
<strong>reload_all_buffers ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Reload all of the currently active highlighted buffers.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_buffer_options"></a>
|
||||
<strong>get_buffer_options ([buf=0|nil])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return the currently active buffer options.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">buf</span>
|
||||
<span class="types"><span class="type">integer</span></span>
|
||||
A value of 0 or nil implies the current buffer.
|
||||
(<em>default</em> 0|nil)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
|
@ -230,7 +305,7 @@ buffer `buf` and attach it to the namespace `ns`.
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2019-10-17 16:25:49 </i>
|
||||
<i style="float:right;">Last updated 2019-10-18 09:40:19 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
66
doc/modules/nvim.html
Normal file
66
doc/modules/nvim.html
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>ldoc</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/colorizer.html">colorizer</a></li>
|
||||
<li><strong>nvim</strong></li>
|
||||
<li><a href="../modules/trie.html">trie</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>nvim</code></h1>
|
||||
<p>Module of magic functions for nvim</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2019-10-18 09:40:19 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -35,6 +35,7 @@
|
|||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/colorizer.html">colorizer</a></li>
|
||||
<li><a href="../modules/nvim.html">nvim</a></li>
|
||||
<li><strong>trie</strong></li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -59,7 +60,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2019-10-17 16:25:49 </i>
|
||||
<i style="float:right;">Last updated 2019-10-18 09:40:19 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ local function new_buffer_options(buf)
|
|||
end
|
||||
|
||||
--- Attach to a buffer and continuously highlight changes.
|
||||
-- @tparam[opt=0] integer buf A value of 0 implies the current buffer.
|
||||
-- @tparam[opt=0|nil] integer buf A value of 0 implies the current buffer.
|
||||
-- @param[opt] options Configuration options as described in `setup`
|
||||
-- @see setup
|
||||
local function attach_to_buffer(buf, options)
|
||||
|
|
@ -246,6 +246,9 @@ local function attach_to_buffer(buf, options)
|
|||
})
|
||||
end
|
||||
|
||||
--- Stop highlighting the current buffer.
|
||||
-- @tparam[opt=0|nil] integer buf A value of 0 or nil implies the current buffer.
|
||||
-- @tparam[opt=DEFAULT_NAMESPACE] integer ns the namespace id.
|
||||
local function detach_from_buffer(buf, ns)
|
||||
if buf == 0 or buf == nil then
|
||||
buf = nvim_get_current_buf()
|
||||
|
|
@ -320,6 +323,22 @@ local function setup(filetypes, default_options)
|
|||
nvim.ex.augroup("END")
|
||||
end
|
||||
|
||||
--- Reload all of the currently active highlighted buffers.
|
||||
local function reload_all_buffers()
|
||||
for buf, buffer_options in pairs(BUFFER_OPTIONS) do
|
||||
attach_to_buffer(buf)
|
||||
end
|
||||
end
|
||||
|
||||
--- Return the currently active buffer options.
|
||||
-- @tparam[opt=0|nil] integer buf A value of 0 or nil implies the current buffer.
|
||||
local function get_buffer_options(buf)
|
||||
if buf == 0 or buf == nil then
|
||||
buf = nvim_get_current_buf()
|
||||
end
|
||||
return merge({}, BUFFER_OPTIONS[buf])
|
||||
end
|
||||
|
||||
--- @export
|
||||
return {
|
||||
DEFAULT_NAMESPACE = DEFAULT_NAMESPACE;
|
||||
|
|
@ -327,17 +346,8 @@ return {
|
|||
attach_to_buffer = attach_to_buffer;
|
||||
detach_from_buffer = detach_from_buffer;
|
||||
highlight_buffer = highlight_buffer;
|
||||
reload_all_buffers = function()
|
||||
for buf, buffer_options in pairs(BUFFER_OPTIONS) do
|
||||
attach_to_buffer(buf)
|
||||
end
|
||||
end;
|
||||
get_buffer_options = function(buf)
|
||||
if buf == 0 or buf == nil then
|
||||
buf = nvim_get_current_buf()
|
||||
end
|
||||
return merge({}, BUFFER_OPTIONS[buf])
|
||||
end;
|
||||
reload_all_buffers = reload_all_buffers;
|
||||
get_buffer_options = get_buffer_options;
|
||||
-- initialize = initialize_trie;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue