Skip to content

Commit 1c3b1f1

Browse files
committed
Update the tool tip example code.
1 parent be60dcd commit 1c3b1f1

File tree

17 files changed

+59
-35
lines changed

17 files changed

+59
-35
lines changed

404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1717

1818

19-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
19+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2020

2121
<!--
2222
Made with Book Theme

docs/basic-plugin/hidden/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1818

1919

20-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
20+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2121

2222
<!--
2323
Made with Book Theme

docs/basic-plugin/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1717

1818

19-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
19+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2020

2121
<link rel="alternate" type="application/rss+xml" href="http://jacobsimpson.github.io/docs/basic-plugin/index.xml" title="Scripting Neovim with Lua" />
2222
<!--

docs/buffers-and-windows/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1717

1818

19-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
19+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2020

2121
<link rel="alternate" type="application/rss+xml" href="http://jacobsimpson.github.io/docs/buffers-and-windows/index.xml" title="Scripting Neovim with Lua" />
2222
<!--

docs/communicating/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1717

1818

19-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
19+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2020

2121
<link rel="alternate" type="application/rss+xml" href="http://jacobsimpson.github.io/docs/communicating/index.xml" title="Scripting Neovim with Lua" />
2222
<!--

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1717

1818

19-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
19+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2020

2121
<link rel="alternate" type="application/rss+xml" href="http://jacobsimpson.github.io/docs/index.xml" title="Scripting Neovim with Lua" />
2222
<!--

docs/interacting/index.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1717

1818

19-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
19+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2020

2121
<link rel="alternate" type="application/rss+xml" href="http://jacobsimpson.github.io/docs/interacting/index.xml" title="Scripting Neovim with Lua" />
2222
<!--
@@ -253,8 +253,7 @@ <h2 id="echo">Echo</h2>
253253

254254
<p>To put a message at the bottom of the screen, and in the <code>:messages</code> buffer:</p>
255255

256-
<pre><code class="language-lua">print(&quot;Something really important.&quot;)
257-
</code></pre>
256+
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-lua" data-lang="lua">print(<span style="color:#e6db74">&#34;Something really important.&#34;</span>)</code></pre></div>
258257

259258
<p>This is analogous to the <code>echo</code> command in VimScript.</p>
260259

@@ -270,14 +269,23 @@ <h4 id="a-floating-window-with-borders">A Floating Window with Borders</h4>
270269

271270
<h4 id="for-a-tool-tip">For a tool tip</h4>
272271

273-
<pre><code class="language-lua">let buf = nvim_create_buf(v:false, v:true)
274-
call nvim_buf_set_lines(buf, 0, -1, v:true, [&quot;test&quot;, &quot;text&quot;])
275-
let opts = {'relative': 'cursor', 'width': 10, 'height': 2, 'col': 0,
276-
\ 'row': 1, 'anchor': 'NW', 'style': 'minimal'}
277-
let win = nvim_open_win(buf, 0, opts)
278-
&quot; optional: change highlight, otherwise Pmenu is used
279-
call nvim_win_set_option(win, 'winhl', 'Normal:MyHighlight')
280-
</code></pre>
272+
<p>This uses Neovim&rsquo;s new floating window capability to overlay a window. The
273+
window is backed by a buffer containing the two lines, &ldquo;test&rdquo; and &ldquo;text&rdquo;.</p>
274+
275+
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-lua" data-lang="lua"><span style="color:#66d9ef">local</span> buf <span style="color:#f92672">=</span> vim.api.nvim_create_buf(<span style="color:#66d9ef">false</span>, <span style="color:#66d9ef">true</span>)
276+
vim.api.nvim_buf_set_lines(buf, <span style="color:#ae81ff">0</span>, <span style="color:#f92672">-</span><span style="color:#ae81ff">1</span>, <span style="color:#66d9ef">true</span>, {<span style="color:#e6db74">&#34;test&#34;</span>, <span style="color:#e6db74">&#34;text&#34;</span>})
277+
<span style="color:#66d9ef">local</span> opts <span style="color:#f92672">=</span> {
278+
relative <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;cursor&#39;</span>,
279+
width <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>,
280+
height <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>,
281+
col <span style="color:#f92672">=</span> <span style="color:#ae81ff">0</span>,
282+
row <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>,
283+
anchor <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;NW&#39;</span>,
284+
style <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;minimal&#39;</span>
285+
}
286+
<span style="color:#66d9ef">local</span> win <span style="color:#f92672">=</span> vim.api.nvim_open_win(buf, <span style="color:#ae81ff">0</span>, opts)
287+
<span style="color:#75715e">-- optional: change highlight, otherwise Pmenu is used</span>
288+
vim.api.nvim_win_set_option(win, <span style="color:#e6db74">&#39;winhl&#39;</span>, <span style="color:#e6db74">&#39;Normal:MyHighlight&#39;</span>)</code></pre></div>
281289
</article>
282290

283291
<div class="book-footer justify-between">

docs/job-control/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<link rel="stylesheet" href="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css" integrity="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY=">
1717

1818

19-
<script defer src="/en.search.min.b0eae01fffe660cbcd1b9d6a59c1a158fac818c2554422bf73f2eba170e38f2a.js" integrity="sha256-sOrgH//mYMvNG51qWcGhWPrIGMJVRCK/c/LroXDjjyo="></script>
19+
<script defer src="/en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js" integrity="sha256-b9QkqU5YtO2EwVTJv5nXLwR9srrFmT85eV1jqxlOIRs="></script>
2020

2121
<link rel="alternate" type="application/rss+xml" href="http://jacobsimpson.github.io/docs/job-control/index.xml" title="Scripting Neovim with Lua" />
2222
<!--

en.search-data.min.416da4d58d358c72086c6f7146a54ea42e6b325285e04650a0e279bedd997dd2.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

en.search.min.6fd424a94e58b4ed84c154c9bf99d72f047db2bac5993f39795d63ab194e211b.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)