diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-01-26 20:10:59 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-01-26 20:38:14 +0100 |
commit | cd64f5abd46e24509b8650f7ecfa30d3f0152b0e (patch) | |
tree | 58c7ce58ac45f2d3f5daad8432f6a2af8f568f7d /scripts/gen_api_vimdoc.py | |
parent | c70c8b607f84611373969d3add2f6ef25e61078f (diff) | |
download | rneovim-cd64f5abd46e24509b8650f7ecfa30d3f0152b0e.tar.gz rneovim-cd64f5abd46e24509b8650f7ecfa30d3f0152b0e.tar.bz2 rneovim-cd64f5abd46e24509b8650f7ecfa30d3f0152b0e.zip |
gen_api_vimdoc.py: Do not wrap on hyphens, long words
- Any long symbol is intentional and should never be hardwrapped.
- Vim help tags are often hyphenated, and hardwrapping on hyphens breaks
the Vim help syntax parser.
Diffstat (limited to 'scripts/gen_api_vimdoc.py')
-rwxr-xr-x | scripts/gen_api_vimdoc.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/gen_api_vimdoc.py b/scripts/gen_api_vimdoc.py index 4e86f15b37..515964bfe8 100755 --- a/scripts/gen_api_vimdoc.py +++ b/scripts/gen_api_vimdoc.py @@ -158,9 +158,12 @@ def doc_wrap(text, prefix='', width=70, func=False): lines[-1] += part return '\n'.join(x.rstrip() for x in lines).rstrip() - return '\n'.join(textwrap.wrap(text.strip(), width=width, - initial_indent=prefix, - subsequent_indent=indent_space)) + tw = textwrap.TextWrapper(break_long_words = False, + break_on_hyphens = False, + width=width, + initial_indent=prefix, + subsequent_indent=indent_space) + return '\n'.join(tw.wrap(text.strip())) def parse_params(parent, width=62): |