mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 23:08:16 +00:00
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.
This commit is contained in:
@@ -291,8 +291,8 @@ nvim_input({keys}) *nvim_input()*
|
|||||||
|
|
||||||
Note:
|
Note:
|
||||||
For mouse events use |nvim_input_mouse()|. The pseudokey
|
For mouse events use |nvim_input_mouse()|. The pseudokey
|
||||||
form "<LeftMouse><col,row>" is deprecated since |api-
|
form "<LeftMouse><col,row>" is deprecated since
|
||||||
level| 6.
|
|api-level| 6.
|
||||||
|
|
||||||
Attributes: ~
|
Attributes: ~
|
||||||
{async}
|
{async}
|
||||||
@@ -1254,8 +1254,8 @@ nvim_buf_set_virtual_text({buffer}, {ns_id}, {line}, {chunks}, {opts})
|
|||||||
By default (and currently the only option) the text will be
|
By default (and currently the only option) the text will be
|
||||||
placed after the buffer text. Virtual text will never cause
|
placed after the buffer text. Virtual text will never cause
|
||||||
reflow, rather virtual text will be truncated at the end of
|
reflow, rather virtual text will be truncated at the end of
|
||||||
the screen line. The virtual text will begin one cell (|lcs-
|
the screen line. The virtual text will begin one cell
|
||||||
eol| or space) after the ordinary text.
|
(|lcs-eol| or space) after the ordinary text.
|
||||||
|
|
||||||
Namespaces are used to support batch deletion/updating of
|
Namespaces are used to support batch deletion/updating of
|
||||||
virtual text. To create a namespace, use
|
virtual text. To create a namespace, use
|
||||||
@@ -1274,8 +1274,8 @@ nvim_buf_set_virtual_text({buffer}, {ns_id}, {line}, {chunks}, {opts})
|
|||||||
{buffer} Buffer handle
|
{buffer} Buffer handle
|
||||||
{ns_id} Namespace to use or 0 to create a namespace, or
|
{ns_id} Namespace to use or 0 to create a namespace, or
|
||||||
-1 for a ungrouped annotation
|
-1 for a ungrouped annotation
|
||||||
{line} Line to annotate with virtual text (zero-
|
{line} Line to annotate with virtual text
|
||||||
indexed)
|
(zero-indexed)
|
||||||
{chunks} A list of [text, hl_group] arrays, each
|
{chunks} A list of [text, hl_group] arrays, each
|
||||||
representing a text chunk with specified
|
representing a text chunk with specified
|
||||||
highlight. `hl_group` element can be omitted for
|
highlight. `hl_group` element can be omitted for
|
||||||
|
@@ -158,9 +158,12 @@ def doc_wrap(text, prefix='', width=70, func=False):
|
|||||||
lines[-1] += part
|
lines[-1] += part
|
||||||
return '\n'.join(x.rstrip() for x in lines).rstrip()
|
return '\n'.join(x.rstrip() for x in lines).rstrip()
|
||||||
|
|
||||||
return '\n'.join(textwrap.wrap(text.strip(), width=width,
|
tw = textwrap.TextWrapper(break_long_words = False,
|
||||||
|
break_on_hyphens = False,
|
||||||
|
width=width,
|
||||||
initial_indent=prefix,
|
initial_indent=prefix,
|
||||||
subsequent_indent=indent_space))
|
subsequent_indent=indent_space)
|
||||||
|
return '\n'.join(tw.wrap(text.strip()))
|
||||||
|
|
||||||
|
|
||||||
def parse_params(parent, width=62):
|
def parse_params(parent, width=62):
|
||||||
|
Reference in New Issue
Block a user