diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-22 21:34:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-22 21:34:46 +0200 |
commit | eada8f5aaae0c072571c87b6dbd3c7992541d698 (patch) | |
tree | 8749bbdf6219618d0b37044aa525b7ad8e9627c8 /scripts/gen_vimdoc.py | |
parent | d0fd66ba82c4ea6d83e2a635eeddb7c7175e02c9 (diff) | |
parent | c1887f465de3f1dd4b99046512eb108e75548c5f (diff) | |
download | rneovim-eada8f5aaae0c072571c87b6dbd3c7992541d698.tar.gz rneovim-eada8f5aaae0c072571c87b6dbd3c7992541d698.tar.bz2 rneovim-eada8f5aaae0c072571c87b6dbd3c7992541d698.zip |
Merge pull request #9871 from justinmk/doc
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-x | scripts/gen_vimdoc.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index a62d18f02e..3449cf68e5 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -219,6 +219,14 @@ def doc_wrap(text, prefix='', width=70, func=False, indent=None): return result +def has_nonexcluded_params(nodes): + """Returns true if any of the given <parameterlist> elements has at least + one non-excluded item.""" + for n in nodes: + if render_params(n) != '': + return True + + def render_params(parent, width=62): """Renders Doxygen <parameterlist> tag as Vim help text.""" name_length = 0 @@ -356,7 +364,7 @@ def render_para(parent, indent='', width=62): chunks = [text] # Generate text from the gathered items. - if len(groups['params']) > 0: + if len(groups['params']) > 0 and has_nonexcluded_params(groups['params']): chunks.append('\nParameters: ~') for child in groups['params']: chunks.append(render_params(child, width=width)) |