diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2022-10-04 15:15:06 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2022-10-04 21:15:06 +0200 |
commit | 6abb48105135ce3ae7eda22334f8104c5ddf20ce (patch) | |
tree | 0efe8c55093d5390fae8fd3386eeb7a35753bb6e | |
parent | b075f49d9229b3e58a4d6677ed8e01db60687fa3 (diff) | |
download | rneovim-6abb48105135ce3ae7eda22334f8104c5ddf20ce.tar.gz rneovim-6abb48105135ce3ae7eda22334f8104c5ddf20ce.tar.bz2 rneovim-6abb48105135ce3ae7eda22334f8104c5ddf20ce.zip |
fix(docs): missing "(" in :help HTML
Problem:
Since https://github.com/neovim/tree-sitter-vimdoc/commit/eba7b5b646546d9fed9b40b2c72b9cc0048f1dfa
any opening paren and its leading whitespace " (" are missing in the
generated HTML. Example:
Use ":qa!<Enter>" (careful, all changes are lost!).
^^missing
Position the cursor on a tag (e.g. bars) and hit CTRL-].
^^missing
Solution:
The main recursive loop only processes named children, so check
named_child_count() instead of child_count(). Then anonymous nodes
won't get lost.
-rw-r--r-- | scripts/gen_help_html.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 3141ff3cdf..ccfa2e567e 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -350,7 +350,7 @@ local function visit_node(root, level, lang_tree, headings, opt, stats) return node_text():match('^%s+') or '' end - if root:child_count() == 0 or node_name == 'ERROR' then + if root:named_child_count() == 0 or node_name == 'ERROR' then text = node_text() else -- Process children and join them with whitespace. |