Skip to content

Commit 86dfc00

Browse files
author
Quarto GHA Workflow Runner
committed
Built site for gh-pages
1 parent 6d12f69 commit 86dfc00

File tree

7 files changed

+270
-214
lines changed

7 files changed

+270
-214
lines changed

.nojekyll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bf6a0826
1+
f7a36ed0

blog/index.html

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

mini.nvim/CHANGELOG.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ <h2 id="toc-title">On this page</h2>
373373
<li><a href="#v0.18.0-mini.misc" id="toc-v0.18.0-mini.misc" class="nav-link" data-scroll-target="#v0.18.0-mini.misc">mini.misc</a>
374374
<ul>
375375
<li><a href="#v0.18.0-mini.misc-evolve" id="toc-v0.18.0-mini.misc-evolve" class="nav-link" data-scroll-target="#v0.18.0-mini.misc-evolve">Evolve</a></li>
376+
<li><a href="#v0.18.0-mini.misc-expand" id="toc-v0.18.0-mini.misc-expand" class="nav-link" data-scroll-target="#v0.18.0-mini.misc-expand">Expand</a></li>
376377
</ul></li>
377378
<li><a href="#v0.18.0-mini.pairs" id="toc-v0.18.0-mini.pairs" class="nav-link" data-scroll-target="#v0.18.0-mini.pairs">mini.pairs</a>
378379
<ul>
@@ -1299,6 +1300,13 @@ <h3 class="anchored" data-anchor-id="v0.18.0-mini.misc-evolve">Evolve</h3>
12991300
<p>The previous “reset by explicitly setting initial background color” behavior is available by setting the new <code>opts.explicit_reset</code> option to <code>true</code>.</p></li>
13001301
</ul>
13011302
</section>
1303+
<section id="v0.18.0-mini.misc-expand" class="level3">
1304+
<h3 class="anchored" data-anchor-id="v0.18.0-mini.misc-expand">Expand</h3>
1305+
<ul>
1306+
<li><p>Add <code>safely()</code> to execute a function reporting its possible error as warning. It can also postpone execution until certain condition (like event, fixed delay, etc.).</p>
1307+
<p>It is intended to be a future replacement for <code>MiniDeps.now()</code> and <code>MiniDeps.later()</code>.</p></li>
1308+
</ul>
1309+
</section>
13021310
</section>
13031311
<section id="v0.18.0-mini.pairs" class="level2">
13041312
<h2 class="anchored" data-anchor-id="v0.18.0-mini.pairs">mini.pairs</h2>

mini.nvim/doc/mini-misc.html

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ <h2 id="toc-title">On this page</h2>
405405
<ul>
406406
<li><a href="#minimisc.resize_window-parameters" id="toc-minimisc.resize_window-parameters" class="nav-link" data-scroll-target="#minimisc.resize_window-parameters">Parameters</a></li>
407407
</ul></li>
408+
<li><a href="#minimisc.safely" id="toc-minimisc.safely" class="nav-link" data-scroll-target="#minimisc.safely">safely()</a>
409+
<ul>
410+
<li><a href="#minimisc.safely-parameters" id="toc-minimisc.safely-parameters" class="nav-link" data-scroll-target="#minimisc.safely-parameters">Parameters</a></li>
411+
<li><a href="#minimisc.safely-usage" id="toc-minimisc.safely-usage" class="nav-link" data-scroll-target="#minimisc.safely-usage">Usage</a></li>
412+
</ul></li>
408413
<li><a href="#minimisc.setup_auto_root" id="toc-minimisc.setup_auto_root" class="nav-link" data-scroll-target="#minimisc.setup_auto_root">setup_auto_root()</a>
409414
<ul>
410415
<li><a href="#minimisc.setup_auto_root-parameters" id="toc-minimisc.setup_auto_root-parameters" class="nav-link" data-scroll-target="#minimisc.setup_auto_root-parameters">Parameters</a></li>
@@ -485,6 +490,7 @@ <h3 class="help-syntax-right-anchor anchored" data-anchor-id="module">Module</h3
485490
<li><p><a href="../../mini.nvim/doc/mini-misc.html#minimisc.log_add">MiniMisc.log_add()</a>, <a href="../../mini.nvim/doc/mini-misc.html#minimisc.log_show">MiniMisc.log_show()</a> and other helper functions to work with a special in-memory log array. Useful when debugging Lua code.</p></li>
486491
<li><p><a href="../../mini.nvim/doc/mini-misc.html#minimisc.put">MiniMisc.put()</a> and <a href="../../mini.nvim/doc/mini-misc.html#minimisc.put_text">MiniMisc.put_text()</a> to pretty print its arguments into command line and current buffer respectively.</p></li>
487492
<li><p><a href="../../mini.nvim/doc/mini-misc.html#minimisc.resize_window">MiniMisc.resize_window()</a> to resize current window to its editable width.</p></li>
493+
<li><p><a href="../../mini.nvim/doc/mini-misc.html#minimisc.safely">MiniMisc.safely()</a> to execute a function on a condition and warn on error. Useful to organize <a href="https://neovim.io/doc/user/helptag.html?tag=init.lua">init.lua</a> in fail-safe sections with simple lazy loading.</p></li>
488494
<li><p><a href="../../mini.nvim/doc/mini-misc.html#minimisc.setup_auto_root">MiniMisc.setup_auto_root()</a> to set up automated change of current directory.</p></li>
489495
<li><p><a href="../../mini.nvim/doc/mini-misc.html#minimisc.setup_termbg_sync">MiniMisc.setup_termbg_sync()</a> to set up terminal background synchronization (removes possible “frame” around current Neovim instance).</p></li>
490496
<li><p><a href="../../mini.nvim/doc/mini-misc.html#minimisc.setup_restore_cursor">MiniMisc.setup_restore_cursor()</a> to set up automated restoration of cursor position on file reopen.</p></li>
@@ -688,6 +694,47 @@ <h4 class="anchored" data-anchor-id="minimisc.resize_window-parameters">Paramete
688694
<hr>
689695
</section>
690696
</section>
697+
<section id="minimisc.safely" class="level3 help-syntax-right-anchor">
698+
<h3 class="help-syntax-right-anchor anchored" data-anchor-id="minimisc.safely">safely()</h3>
699+
<p align="center">
700+
<code>MiniMisc.safely</code>(<span class="help-syntax-special">{when}</span>, <span class="help-syntax-special">{f}</span>)
701+
</p>
702+
<p>Execute a function on a condition and warn on error</p>
703+
<p>Input function is executed exactly once. Its possible error is captured and is shown as a <a href="https://neovim.io/doc/user/helptag.html?tag=vim.notify()">vim.notify()</a> warning.</p>
704+
<p>Useful to organize <a href="https://neovim.io/doc/user/helptag.html?tag=init.lua">init.lua</a> in fail-safe sections with simple lazy loading.</p>
705+
<section id="minimisc.safely-parameters" class="level4">
706+
<h4 class="anchored" data-anchor-id="minimisc.safely-parameters">Parameters</h4>
707+
<p><span class="help-syntax-special">{when}</span> <code>(string)</code> When to execute a function. One of:</p>
708+
<ul>
709+
<li><p><code>'now'</code> - immediately.</p></li>
710+
<li><p><code>'later'</code> - queue to be executed soon without blocking the execution of next code in file. Queued functions are executed in order they are added.</p></li>
711+
<li><p><code>'delay:&lt;number&gt;'</code> - after a specified delay with <a href="https://neovim.io/doc/user/helptag.html?tag=vim.defer_fn()">vim.defer_fn()</a>.</p></li>
712+
<li><p><code>'event:&lt;events&gt;'</code> - on whichever specified event is triggered first.</p></li>
713+
<li><p><code>'event:&lt;events&gt;~&lt;patterns&gt;</code> - same as above, but events must match specified <a href="https://neovim.io/doc/user/helptag.html?tag=autocmd-pattern">autocmd-pattern</a>.</p></li>
714+
<li><p><code>'filetype:&lt;filetypes&gt;'</code> - same as <code>'event:FileType~&lt;filetypes&gt;'</code>, but follow successful function execution with <a href="https://neovim.io/doc/user/helptag.html?tag=filetype-detect">filetype-detect</a> for all normal buffers (if new <a href="https://neovim.io/doc/user/helptag.html?tag=ftdetect">ftdetect</a> scripts were added) and sourcing <a href="https://neovim.io/doc/user/helptag.html?tag=ftplugin">ftplugin</a> (for buffers matching <code>&lt;filetypes&gt;</code>). Intended to be used for loading “language plugins”.</p></li>
715+
</ul>
716+
<p><span class="help-syntax-special">{f}</span> <code>(function)</code> Function to execute (without arguments).</p>
717+
</section>
718+
<section id="minimisc.safely-usage" class="level4">
719+
<h4 class="anchored" data-anchor-id="minimisc.safely-usage">Usage</h4>
720+
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4"><pre class="sourceCode lua code-with-copy"><code class="sourceCode lua"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="va">MiniMisc</span><span class="op">.</span>safely<span class="op">(</span><span class="st">'later'</span><span class="op">,</span> <span class="kw">function</span><span class="op">()</span></span>
721+
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="va">vim</span><span class="op">.</span>notify<span class="op">(</span><span class="st">'This will be executed after the next "now" call'</span><span class="op">)</span></span>
722+
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span><span class="op">)</span></span>
723+
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="va">MiniMisc</span><span class="op">.</span>safely<span class="op">(</span><span class="st">'now'</span><span class="op">,</span> <span class="kw">function</span><span class="op">()</span> <span class="fu">error</span><span class="op">(</span><span class="st">'This will be a warning'</span><span class="op">)</span> <span class="kw">end</span><span class="op">)</span></span>
724+
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a></span>
725+
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a><span class="va">MiniMisc</span><span class="op">.</span>safely<span class="op">(</span><span class="st">'event:InsertEnter'</span><span class="op">,</span> <span class="kw">function</span><span class="op">()</span></span>
726+
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">require</span><span class="op">(</span><span class="st">'mini.completion'</span><span class="op">).</span>setup<span class="op">()</span></span>
727+
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span><span class="op">)</span></span>
728+
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a><span class="va">MiniMisc</span><span class="op">.</span>safely<span class="op">(</span><span class="st">'event:CmdlineEnter~/'</span><span class="op">,</span> <span class="kw">function</span><span class="op">()</span></span>
729+
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> <span class="va">vim</span><span class="op">.</span>notify<span class="op">(</span><span class="st">'Start searching for the first time'</span><span class="op">)</span></span>
730+
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span><span class="op">)</span></span>
731+
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a></span>
732+
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a><span class="va">MiniMisc</span><span class="op">.</span>safely<span class="op">(</span><span class="st">'filetype:tex,plaintex'</span><span class="op">,</span> <span class="kw">function</span><span class="op">()</span></span>
733+
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a> <span class="co">-- Load plugin to improve writing LaTeX</span></span>
734+
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span><span class="op">)</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
735+
<hr>
736+
</section>
737+
</section>
691738
<section id="minimisc.setup_auto_root" class="level3 help-syntax-right-anchor">
692739
<h3 class="help-syntax-right-anchor anchored" data-anchor-id="minimisc.setup_auto_root">setup_auto_root()</h3>
693740
<p align="center">
@@ -706,8 +753,8 @@ <h4 class="anchored" data-anchor-id="minimisc.setup_auto_root-parameters">Parame
706753
</section>
707754
<section id="minimisc.setup_auto_root-usage" class="level4">
708755
<h4 class="anchored" data-anchor-id="minimisc.setup_auto_root-usage">Usage</h4>
709-
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4"><pre class="sourceCode lua code-with-copy"><code class="sourceCode lua"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span><span class="op">(</span><span class="st">'mini.misc'</span><span class="op">).</span>setup<span class="op">()</span></span>
710-
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="va">MiniMisc</span><span class="op">.</span>setup_auto_root<span class="op">()</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
756+
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5"><pre class="sourceCode lua code-with-copy"><code class="sourceCode lua"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span><span class="op">(</span><span class="st">'mini.misc'</span><span class="op">).</span>setup<span class="op">()</span></span>
757+
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="va">MiniMisc</span><span class="op">.</span>setup_auto_root<span class="op">()</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
711758
<hr>
712759
</section>
713760
</section>
@@ -773,7 +820,7 @@ <h4 class="anchored" data-anchor-id="minimisc.setup_restore_cursor-parameters">P
773820
</section>
774821
<section id="minimisc.setup_restore_cursor-usage" class="level4">
775822
<h4 class="anchored" data-anchor-id="minimisc.setup_restore_cursor-usage">Usage</h4>
776-
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5"><pre class="sourceCode lua code-with-copy"><code class="sourceCode lua"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span><span class="op">(</span><span class="st">'mini.misc'</span><span class="op">).</span>setup_restore_cursor<span class="op">()</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
823+
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6"><pre class="sourceCode lua code-with-copy"><code class="sourceCode lua"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span><span class="op">(</span><span class="st">'mini.misc'</span><span class="op">).</span>setup_restore_cursor<span class="op">()</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
777824
<hr>
778825
</section>
779826
</section>
@@ -844,8 +891,8 @@ <h3 class="help-syntax-right-anchor anchored" data-anchor-id="minimisc.use_neste
844891
<p>This works by parsing ‘commentstring’ buffer option, extracting non-whitespace comment leader (symbols on the left of commented line), and locally modifying ‘comments’ option (by prepending <code>n:&lt;leader&gt;</code>). Does nothing if ‘commentstring’ is empty or has comment symbols both in front and back (like “/%s/”).</p>
845892
<p>Nested comment leader added with this function is useful for formatting nested comments. For example, have in Lua “first-level” comments with ‘–’ and “second-level” comments with ‘—-’. With nested comment leader second type can be formatted with <code>gq</code> in the same way as first one.</p>
846893
<p>Recommended usage is with <a href="https://neovim.io/doc/user/helptag.html?tag=autocmd">autocmd</a>:</p>
847-
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6"><pre class="sourceCode lua code-with-copy"><code class="sourceCode lua"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="kw">local</span> <span class="va">use_nested_comments</span> <span class="op">=</span> <span class="kw">function</span><span class="op">()</span> <span class="va">MiniMisc</span><span class="op">.</span>use_nested_comments<span class="op">()</span> <span class="kw">end</span></span>
848-
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="va">vim</span><span class="op">.</span><span class="va">api</span><span class="op">.</span>nvim_create_autocmd<span class="op">(</span><span class="st">'BufEnter'</span><span class="op">,</span> <span class="op">{</span> <span class="va">callback</span> <span class="op">=</span> <span class="va">use_nested_comments</span> <span class="op">})</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
894+
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7"><pre class="sourceCode lua code-with-copy"><code class="sourceCode lua"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="kw">local</span> <span class="va">use_nested_comments</span> <span class="op">=</span> <span class="kw">function</span><span class="op">()</span> <span class="va">MiniMisc</span><span class="op">.</span>use_nested_comments<span class="op">()</span> <span class="kw">end</span></span>
895+
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="va">vim</span><span class="op">.</span><span class="va">api</span><span class="op">.</span>nvim_create_autocmd<span class="op">(</span><span class="st">'BufEnter'</span><span class="op">,</span> <span class="op">{</span> <span class="va">callback</span> <span class="op">=</span> <span class="va">use_nested_comments</span> <span class="op">})</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
849896
<p>Note: for most filetypes ‘commentstring’ option is added only when buffer with this filetype is entered, so using non-current <code>buf_id</code> can not lead to desired effect.</p>
850897
<section id="minimisc.use_nested_comments-parameters" class="level4">
851898
<h4 class="anchored" data-anchor-id="minimisc.use_nested_comments-parameters">Parameters</h4>

mini.nvim/readmes/mini-misc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ <h2 class="anchored" data-anchor-id="features">Features</h2>
425425
<li><code>log_add()</code> / <code>log_show()</code> and other helper functions to work with a special in-memory log array. Useful when debugging Lua code (instead of <code>print()</code>).</li>
426426
<li><code>put()</code> and <code>put_text()</code> print Lua objects in command line and current buffer respectively.</li>
427427
<li><code>resize_window()</code> resizes current window to its editable width.</li>
428+
<li><code>safely()</code> to execute a function on a condition and warn on error. Useful to organize ‘init.lua’ in fail-safe sections with simple lazy loading.</li>
428429
<li><code>setup_auto_root()</code> sets up automated change of current directory.</li>
429430
<li><code>setup_termbg_sync()</code> to set up terminal background synchronization (removes possible “frame” around current Neovim instance).</li>
430431
<li><code>setup_restore_cursor()</code> sets up automated restoration of cursor position on file reopen.</li>

0 commit comments

Comments
 (0)