neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 6abb48105135ce3ae7eda22334f8104c5ddf20ce
parent b075f49d9229b3e58a4d6677ed8e01db60687fa3
Author: Justin M. Keyes <justinkz@gmail.com>
Date:   Tue,  4 Oct 2022 15:15:06 +0200

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.

Diffstat:
Mscripts/gen_help_html.lua | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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.