summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/public/posts/2021-10-02
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-09-20 19:56:52 +0900
committernsfisis <nsfisis@gmail.com>2023-09-20 19:56:57 +0900
commita84908b7e8a0e2423afd6b836eccf27a420270b4 (patch)
tree00204b62358f8c57fcb36f601db360626484cc1a /vhosts/blog/public/posts/2021-10-02
parent0b488f85380f964c40b0b9aae69c6611bc7978bc (diff)
downloadnsfisis.dev-a84908b7e8a0e2423afd6b836eccf27a420270b4.tar.gz
nsfisis.dev-a84908b7e8a0e2423afd6b836eccf27a420270b4.tar.zst
nsfisis.dev-a84908b7e8a0e2423afd6b836eccf27a420270b4.zip
feat(blog/nuldoc): change content format from DocBook to NulDoc
Diffstat (limited to 'vhosts/blog/public/posts/2021-10-02')
-rw-r--r--vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html4
-rw-r--r--vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html6
-rw-r--r--vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html4
-rw-r--r--vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html24
-rw-r--r--vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html12
-rw-r--r--vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html10
-rw-r--r--vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html12
7 files changed, 36 insertions, 36 deletions
diff --git a/vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html b/vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
index 75ba6ea9..0954830d 100644
--- a/vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
+++ b/vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
@@ -69,7 +69,7 @@
タイトル落ち。まずはこのコードを見て欲しい。
</p>
- <pre class="highlight" language="cpp" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;iostream&gt;</span></span>
+ <pre class="highlight" language="cpp"><code class="highlight"><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;iostream&gt;</span></span>
[[<span class="hljs-keyword">alignas</span>]] [[<span class="hljs-keyword">alignof</span>]] [[<span class="hljs-keyword">and</span>]] [[<span class="hljs-keyword">and_eq</span>]] [[<span class="hljs-keyword">asm</span>]] [[<span class="hljs-keyword">auto</span>]] [[<span class="hljs-keyword">bitand</span>]]
[[<span class="hljs-keyword">bitor</span>]] [[<span class="hljs-type">bool</span>]] [[<span class="hljs-keyword">break</span>]] [[<span class="hljs-keyword">case</span>]] [[<span class="hljs-keyword">catch</span>]] [[<span class="hljs-type">char</span>]] [[<span class="hljs-type">char16_t</span>]]
@@ -132,7 +132,7 @@
上のコードでは <code>[[using]]</code> をコメントアウトしているが、これは <code>using</code> キーワードのみ属性構文の中で意味を持つからであり、このコメントアウトを外すとコンパイルに失敗する。
</p>
- <pre class="highlight" language="cpp" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">// using の例</span>
+ <pre class="highlight" language="cpp"><code class="highlight"><span class="hljs-comment">// using の例</span>
[[<span class="hljs-keyword">using</span> foo: attr1, attr2]] <span class="hljs-type">int</span> x; <span class="hljs-comment">// [[foo::attr1, foo::attr2]] の糖衣構文</span></code></pre>
<p>
diff --git a/vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html b/vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html
index 105b946b..cb6efafb 100644
--- a/vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html
+++ b/vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html
@@ -73,7 +73,7 @@
Python でクロージャを作ろうと、次のようなコードを書いた。
</p>
- <pre class="highlight" language="python" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
+ <pre class="highlight" language="python"><code class="highlight"><span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
x = <span class="hljs-number">0</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">g</span>():
x += <span class="hljs-number">1</span>
@@ -95,7 +95,7 @@ f()</code></pre>
local変数 <code>x</code> が代入前に参照された、とある。これは、<code>f</code> の <code>x</code> を参照するのではなく、新しく別の変数を <code>g</code> 内に作ってしまっているため。 前述のコードを宣言と代入を便宜上分けて書き直すと次のようになる。<code>var</code> を変数宣言のための構文として擬似的に利用している。
</p>
- <pre class="highlight" language="python" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># 注: var は正しい Python の文法ではない。上記参照のこと</span>
+ <pre class="highlight" language="python"><code class="highlight"><span class="hljs-comment"># 注: var は正しい Python の文法ではない。上記参照のこと</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
var x <span class="hljs-comment"># f の local変数 &#x27;x&#x27; を宣言</span>
x = <span class="hljs-number">0</span> <span class="hljs-comment"># x に 0 を代入</span>
@@ -110,7 +110,7 @@ f()</code></pre>
当初の意図を表現するには、次のように書けばよい。
</p>
- <pre class="highlight" language="python" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
+ <pre class="highlight" language="python"><code class="highlight"><span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
x = <span class="hljs-number">0</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">g</span>():
<span class="hljs-keyword">nonlocal</span> x <span class="hljs-comment">## (*)</span>
diff --git a/vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html b/vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html
index d9f9e79f..16b6b0bb 100644
--- a/vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html
+++ b/vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html
@@ -78,7 +78,7 @@
上記ページの例から引用する:
</p>
- <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ ruby-1.9.1 -ve &apos;p RUBY_ENGINE&apos;
+ <pre class="highlight" language="shell-session"><code>$ ruby-1.9.1 -ve &apos;p RUBY_ENGINE&apos;
ruby 1.9.1p0 (2009-03-04 revision 22762) [x86_64-linux]
&quot;ruby&quot;
$ jruby -ve &apos;p RUBY_ENGINE&apos;
@@ -203,7 +203,7 @@ jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [i386-java]
<a href="https://github.com/mruby/mruby/blob/ed29d74bfd95362eaeb946fcf7e865d80346b62b/include/mruby/version.h#L32-L35">mruby 該当部分のソース</a> より引用:
</p>
- <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">/*
+ <pre class="highlight" language="c"><code class="highlight"><span class="hljs-comment">/*
* Ruby engine.
*/</span>
<span class="hljs-meta">#<span class="hljs-keyword">define</span> MRUBY_RUBY_ENGINE <span class="hljs-string">&quot;mruby&quot;</span></span></code></pre>
diff --git a/vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html b/vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html
index fcd653e2..a483ee73 100644
--- a/vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html
+++ b/vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html
@@ -78,7 +78,7 @@
使われることは稀だが、Ruby では <code>then</code> がキーワードになっている。次のように使う:
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> cond <span class="hljs-keyword">then</span>
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-keyword">if</span> cond <span class="hljs-keyword">then</span>
puts <span class="hljs-string">&quot;Y&quot;</span>
<span class="hljs-keyword">else</span>
puts <span class="hljs-string">&quot;N&quot;</span>
@@ -88,7 +88,7 @@
このキーワードが現れうる場所はいくつかあり、<code>if</code>、<code>unless</code>、<code>rescue</code>、<code>case</code> 構文がそれに当たる。 上記のように、何か条件を書いた後 <code>then</code> を置き、式がそこで終了していることを示すマーカーとして機能する。
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># Example:</span>
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-comment"># Example:</span>
<span class="hljs-keyword">if</span> x <span class="hljs-keyword">then</span>
a
@@ -116,13 +116,13 @@
普通 Ruby のコードで <code>then</code> を書くことはない。なぜか。次のコードを実行してみるとわかる。
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> <span class="hljs-literal">true</span> puts <span class="hljs-string">&#x27;Hello, World!&#x27;</span> <span class="hljs-keyword">end</span></code></pre>
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-keyword">if</span> <span class="hljs-literal">true</span> puts <span class="hljs-string">&#x27;Hello, World!&#x27;</span> <span class="hljs-keyword">end</span></code></pre>
<p>
次のような構文エラーが出力される。
</p>
- <pre class="highlight monospaced"><code>20:1: syntax error, unexpected local variable or method, expecting `then&apos; or &apos;;&apos; or &apos;\n&apos;
+ <pre class="highlight"><code>20:1: syntax error, unexpected local variable or method, expecting `then&apos; or &apos;;&apos; or &apos;\n&apos;
if true puts &apos;Hello, World!&apos; end
^~~~
20:1: syntax error, unexpected `end&apos;, expecting end-of-input
@@ -136,7 +136,7 @@ if true puts &apos;Hello, World!&apos; end
ポイントは改行が <code>then</code> (や <code>;</code>) の代わりとなることである。<code>true</code> の後に改行を入れてみる。
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> <span class="hljs-literal">true</span>
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-keyword">if</span> <span class="hljs-literal">true</span>
puts <span class="hljs-string">&#x27;Hello, World!&#x27;</span> <span class="hljs-keyword">end</span></code></pre>
<p>
@@ -150,18 +150,18 @@ puts <span class="hljs-string">&#x27;Hello, World!&#x27;</span> <span class="hlj
なぜ <code>then</code> や <code>;</code> や改行 (以下 「<code>then</code> 等」) が必要なのだろうか。次の例を見てほしい:
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> a b <span class="hljs-keyword">end</span></code></pre>
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-keyword">if</span> a b <span class="hljs-keyword">end</span></code></pre>
<p>
<code>then</code> も <code>;</code> も改行もないのでエラーになるが、これは条件式がどこまで続いているのかわからないためだ。 この例は二通りに解釈できる。
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># a という変数かメソッドの評価結果が truthy なら b という変数かメソッドを評価</span>
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-comment"># a という変数かメソッドの評価結果が truthy なら b という変数かメソッドを評価</span>
<span class="hljs-keyword">if</span> a <span class="hljs-keyword">then</span>
b
<span class="hljs-keyword">end</span></code></pre>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># a というメソッドに b という変数かメソッドの評価結果を渡して呼び出し、</span>
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-comment"># a というメソッドに b という変数かメソッドの評価結果を渡して呼び出し、</span>
<span class="hljs-comment"># その結果が truthy なら何もしない</span>
<span class="hljs-keyword">if</span> a(b) <span class="hljs-keyword">then</span>
<span class="hljs-keyword">end</span></code></pre>
@@ -185,7 +185,7 @@ b
<a href="https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986">https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986</a>
</p>
- <pre class="highlight" language="yacc" linenumbering="unnumbered"><code>p_case_body : keyword_in
+ <pre class="highlight" language="yacc"><code>p_case_body : keyword_in
{
SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
p-&gt;command_start = FALSE;
@@ -216,7 +216,7 @@ p_cases
簡略版:
</p>
- <pre class="highlight" language="yacc" linenumbering="unnumbered"><code>p_case_body : keyword_in p_top_expr then compstmt p_cases
+ <pre class="highlight" language="yacc"><code>p_case_body : keyword_in p_top_expr then compstmt p_cases
;</code></pre>
<p>
@@ -227,7 +227,7 @@ p_cases
これにより、<code>case</code> - <code>when</code> による従来の構文と同じように、<code>then</code> 等をパターンの後ろに挿入すればよいことがわかった。つまり次の3通りのいずれかになる:
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">case</span> x
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-keyword">case</span> x
<span class="hljs-keyword">in</span> <span class="hljs-number">1</span> <span class="hljs-keyword">then</span> a
<span class="hljs-keyword">in</span> <span class="hljs-number">2</span> <span class="hljs-keyword">then</span> b
<span class="hljs-keyword">in</span> <span class="hljs-number">3</span> <span class="hljs-keyword">then</span> c
@@ -252,7 +252,7 @@ p_cases
ところで、<code>p_top_expr</code> には <code>if</code> による guard clause が書けるので、その場合は <code>if</code> - <code>then</code> と似たような見た目になる。
</p>
- <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">case</span> x
+ <pre class="highlight" language="ruby"><code class="highlight"><span class="hljs-keyword">case</span> x
<span class="hljs-keyword">in</span> <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> a
<span class="hljs-keyword">in</span> n <span class="hljs-keyword">if</span> n &lt; <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> b
<span class="hljs-keyword">in</span> n <span class="hljs-keyword">then</span> c
diff --git a/vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html b/vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html
index 7509e3a0..063f4f42 100644
--- a/vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html
+++ b/vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html
@@ -68,7 +68,7 @@
Rust において、プリミティブ型の名前は予約語でない。したがって、次のコードは合法である。
</p>
- <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">#![allow(non_camel_case_types)]</span>
+ <pre class="highlight" language="rust"><code class="highlight"><span class="hljs-meta">#![allow(non_camel_case_types)]</span>
<span class="hljs-meta">#![allow(dead_code)]</span>
<span class="hljs-keyword">struct</span> <span class="hljs-title class_">bool</span>;
@@ -122,7 +122,7 @@
<code>rustc</code> はセルフホストされている (= <code>rustc</code> 自身が Rust で書かれている) ので、<code>bool</code> や <code>char</code> などで適当に検索をかけてもノイズが多すぎて話にならない。 しかし、お誂え向きなことに <code>i128</code>/<code>u128</code> というコンパイラ自身が使うことがなさそうな型が存在するのでこれを使って <code>git grep</code> してみる。
</p>
- <pre class="highlight monospaced"><code>$ git grep &quot;\bi128\b&quot; | wc # i128
+ <pre class="highlight"><code>$ git grep &quot;\bi128\b&quot; | wc # i128
165 1069 15790
$ git grep &quot;\bu128\b&quot; | wc # u128
@@ -135,7 +135,7 @@ $ git grep &quot;\bbool\b&quot; | wc # cf. bool の結果
165 程度であれば探すことができそうだ。今回は、クレート名を見ておおよその当たりをつけた。
</p>
- <pre class="highlight monospaced"><code>$ git grep &quot;\bi128\b&quot;
+ <pre class="highlight"><code>$ git grep &quot;\bi128\b&quot;
...
rustc_resolve/src/lib.rs: table.insert(sym::i128, Int(IntTy::I128));
...</code></pre>
@@ -144,7 +144,7 @@ rustc_resolve/src/lib.rs: table.insert(sym::i128, Int(IntTy::I128));
<code>rustc_resolve</code> というのはいかにも名前解決を担いそうなクレート名である。該当箇所を見てみる。
</p>
- <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">/// Interns the names of the primitive types.</span>
+ <pre class="highlight" language="rust"><code class="highlight"><span class="hljs-comment">/// Interns the names of the primitive types.</span>
<span class="hljs-comment">///</span>
<span class="hljs-comment">/// All other types are defined somewhere and possibly imported, but the primitive ones need</span>
<span class="hljs-comment">/// special handling, since they have no place of origin.</span>
@@ -191,7 +191,7 @@ rustc_resolve/src/lib.rs: table.insert(sym::i128, Int(IntTy::I128));
とある。次はこの struct の使用箇所を追う。追うと言っても使われている箇所は次の一箇所しかない。なお説明に不要な箇所は大きく削っている。
</p>
- <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">/// This resolves the identifier `ident` in the namespace `ns` in the current lexical scope.</span>
+ <pre class="highlight" language="rust"><code class="highlight"><span class="hljs-comment">/// This resolves the identifier `ident` in the namespace `ns` in the current lexical scope.</span>
<span class="hljs-comment">/// (略)</span>
<span class="hljs-keyword">fn</span> <span class="hljs-title function_">resolve_ident_in_lexical_scope</span>(
&amp;<span class="hljs-keyword">mut</span> <span class="hljs-keyword">self</span>,
@@ -229,7 +229,7 @@ rustc_resolve/src/lib.rs: table.insert(sym::i128, Int(IntTy::I128));
動作がわかったところで、例として次のコードを考える。
</p>
- <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">#![allow(non_camel_case_types)]</span>
+ <pre class="highlight" language="rust"><code class="highlight"><span class="hljs-meta">#![allow(non_camel_case_types)]</span>
<span class="hljs-keyword">struct</span> <span class="hljs-title class_">bool</span>;
diff --git a/vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html b/vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html
index ea874004..69e28ce1 100644
--- a/vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html
+++ b/vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html
@@ -119,14 +119,14 @@
<a href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L85-L86">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L85-L86</a>
</p>
- <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight">{<span class="hljs-string">&quot;BufAdd&quot;</span>, EVENT_BUFADD},
+ <pre class="highlight" language="c"><code class="highlight">{<span class="hljs-string">&quot;BufAdd&quot;</span>, EVENT_BUFADD},
{<span class="hljs-string">&quot;BufCreate&quot;</span>, EVENT_BUFADD},</code></pre>
<p>
<a href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L95-L97">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L95-L97</a>
</p>
- <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight">{<span class="hljs-string">&quot;BufRead&quot;</span>, EVENT_BUFREADPOST},
+ <pre class="highlight" language="c"><code class="highlight">{<span class="hljs-string">&quot;BufRead&quot;</span>, EVENT_BUFREADPOST},
{<span class="hljs-string">&quot;BufReadCmd&quot;</span>, EVENT_BUFREADCMD},
{<span class="hljs-string">&quot;BufReadPost&quot;</span>, EVENT_BUFREADPOST},</code></pre>
@@ -134,7 +134,7 @@
<a href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L103-L105">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L103-L105</a>
</p>
- <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight">{<span class="hljs-string">&quot;BufWrite&quot;</span>, EVENT_BUFWRITEPRE},
+ <pre class="highlight" language="c"><code class="highlight">{<span class="hljs-string">&quot;BufWrite&quot;</span>, EVENT_BUFWRITEPRE},
{<span class="hljs-string">&quot;BufWritePost&quot;</span>, EVENT_BUFWRITEPOST},
{<span class="hljs-string">&quot;BufWritePre&quot;</span>, EVENT_BUFWRITEPRE},</code></pre>
</section>
@@ -149,7 +149,7 @@
<a href="https://github.com/neovim/neovim/blob/71d4f5851f068eeb432af34850dddda8cc1c71e3/src/nvim/auevents.lua#L119-L124">https://github.com/neovim/neovim/blob/71d4f5851f068eeb432af34850dddda8cc1c71e3/src/nvim/auevents.lua#L119-L124</a>
</p>
- <pre class="highlight" language="lua" linenumbering="unnumbered"><code class="highlight">aliases = {
+ <pre class="highlight" language="lua"><code class="highlight">aliases = {
BufCreate = <span class="hljs-string">&#x27;BufAdd&#x27;</span>,
BufRead = <span class="hljs-string">&#x27;BufReadPost&#x27;</span>,
BufWrite = <span class="hljs-string">&#x27;BufWritePre&#x27;</span>,
@@ -160,7 +160,7 @@ FileEncoding = <span class="hljs-string">&#x27;EncodingChanged&#x27;</span>,
ところで、上では取り上げなかった <code>FileEncoding</code> だが、これは <code>:help FileEncoding</code> にしっかりと書いてある。
</p>
- <pre class="highlight monospaced"><code> *FileEncoding*
+ <pre class="highlight"><code> *FileEncoding*
FileEncoding Obsolete. It still works and is equivalent
to |EncodingChanged|.</code></pre>
</section>
diff --git a/vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html b/vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html
index 9ca04808..deb55b48 100644
--- a/vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html
+++ b/vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html
@@ -64,7 +64,7 @@
<section id="section--tl-dr">
<h2><a href="#section--tl-dr">TL; DR</a></h2>
- <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">&quot; License: Public Domain</span>
+ <pre class="highlight" language="vim"><code class="highlight"><span class="hljs-comment">&quot; License: Public Domain</span>
command! -bar -<span class="hljs-built_in">range</span>=%
\ Reverse
@@ -137,7 +137,7 @@ command! -bar -<span class="hljs-built_in">range</span>=%
なお、<code>:g/^/m0</code> は全ての行を入れ替えるが、<code>:N,Mg/^/mN-1</code> とすることで N行目から M行目を処理範囲とするよう拡張できる。手でこれを入力するわけにはいかないので、次のようなコマンドを用意する。
</p>
- <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">command! -bar -<span class="hljs-built_in">range</span>=%
+ <pre class="highlight" language="vim"><code class="highlight">command! -bar -<span class="hljs-built_in">range</span>=%
\ Reverse
\ <span class="hljs-symbol">&lt;line1&gt;</span>,<span class="hljs-symbol">&lt;line2&gt;</span>g/^/<span class="hljs-keyword">m</span><span class="hljs-symbol">&lt;line1&gt;</span>-<span class="hljs-number">1</span></code></pre>
@@ -172,7 +172,7 @@ command! -bar -<span class="hljs-built_in">range</span>=%
前述した <code>:Reverse</code> コマンドの定義を少し変えて、次のようにする:
</p>
- <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">function!</span> <span class="hljs-title">s</span>:reverse_lines<span class="hljs-params">(from, to)</span> abort
+ <pre class="highlight" language="vim"><code class="highlight"><span class="hljs-keyword">function!</span> <span class="hljs-title">s</span>:reverse_lines<span class="hljs-params">(from, to)</span> abort
<span class="hljs-keyword">execute</span> <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d,%dg/^/m%d&quot;</span>, <span class="hljs-variable">a:from</span>, <span class="hljs-variable">a:to</span>, <span class="hljs-variable">a:from</span> - <span class="hljs-number">1</span>)
<span class="hljs-keyword">endfunction</span>
@@ -198,7 +198,7 @@ command! -bar -<span class="hljs-built_in">range</span>=%
</p>
<p>
- <em role="strong">Autocommands do not change the current search patterns.</em> Vim saves the current search patterns before executing autocommands then restores them after the autocommands finish. This means that autocommands do not affect the strings highlighted with the `hlsearch&apos; option.
+ <strong>Autocommands do not change the current search patterns.</strong> Vim saves the current search patterns before executing autocommands then restores them after the autocommands finish. This means that autocommands do not affect the strings highlighted with the `hlsearch&apos; option.
</p>
</blockquote>
@@ -212,7 +212,7 @@ command! -bar -<span class="hljs-built_in">range</span>=%
</p>
<p>
- (略) This command doesn’t work in an autocommand, because the highlighting state is saved and restored when executing autocommands |autocmd-searchpat|. <em role="strong">Same thing for when invoking a user function.</em>
+ (略) This command doesn’t work in an autocommand, because the highlighting state is saved and restored when executing autocommands |autocmd-searchpat|. <strong>Same thing for when invoking a user function.</strong>
</p>
</blockquote>
@@ -229,7 +229,7 @@ command! -bar -<span class="hljs-built_in">range</span>=%
</p>
</blockquote>
- <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">command! -bar -<span class="hljs-built_in">range</span>=%
+ <pre class="highlight" language="vim"><code class="highlight">command! -bar -<span class="hljs-built_in">range</span>=%
\ Reverse
\ keeppatterns <span class="hljs-symbol">&lt;line1&gt;</span>,<span class="hljs-symbol">&lt;line2&gt;</span>g/^/<span class="hljs-keyword">m</span><span class="hljs-symbol">&lt;line1&gt;</span>-<span class="hljs-number">1</span></code></pre>