aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-22 21:24:46 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-04-22 21:24:46 +0200
commitc1887f465de3f1dd4b99046512eb108e75548c5f (patch)
treeb95e1b3a21ccb8c7c5071cf4aa5a29882d61eae0
parent544305e8027440d25e518962b1ab79e14930dae4 (diff)
downloadrneovim-c1887f465de3f1dd4b99046512eb108e75548c5f.tar.gz
rneovim-c1887f465de3f1dd4b99046512eb108e75548c5f.tar.bz2
rneovim-c1887f465de3f1dd4b99046512eb108e75548c5f.zip
gen_vimdoc.py: skip "Parameters" header if all excluded
-rw-r--r--runtime/doc/api.txt6
-rwxr-xr-xscripts/gen_vimdoc.py10
2 files changed, 9 insertions, 7 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 8ef058fbb8..b2e37a6d60 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -491,8 +491,6 @@ nvim_set_current_dir({dir}) *nvim_set_current_dir()*
nvim_get_current_line() *nvim_get_current_line()*
Gets the current line.
- Parameters: ~
-
Return: ~
Current line string
@@ -505,8 +503,6 @@ nvim_set_current_line({line}) *nvim_set_current_line()*
nvim_del_current_line() *nvim_del_current_line()*
Deletes the current line.
- Parameters: ~
-
nvim_get_var({name}) *nvim_get_var()*
Gets a global (g:) variable.
@@ -1758,8 +1754,6 @@ nvim_ui_detach() *nvim_ui_detach()*
Removes the client from the list of UIs. |nvim_list_uis()|
- Parameters: ~
-
nvim_ui_try_resize({width}, {height}) *nvim_ui_try_resize()*
TODO: Documentation
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))