fix(gen_vimdoc.py): spacing around inline elements #16092

The spacing fix drew attention to a couple of places that were using
incorrect formatting such as the key listing for `nvim_open_win`, so
those were fixed too.
This commit is contained in:
Gregory Anders
2021-10-19 13:55:22 -06:00
committed by GitHub
parent 064411ea7f
commit dfef90a518
6 changed files with 51 additions and 45 deletions

View File

@@ -1877,7 +1877,7 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
callbacks. callbacks.
{opts} Optional parameters. {opts} Optional parameters.
• on_lines: Lua callback invoked on change. • on_lines: Lua callback invoked on change.
Return`true`to detach. Args: Return `true` to detach. Args:
• the string "lines" • the string "lines"
• buffer handle • buffer handle
• b:changedtick • b:changedtick
@@ -1893,7 +1893,7 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()*
• on_bytes: lua callback invoked on change. • on_bytes: lua callback invoked on change.
This callback receives more granular This callback receives more granular
information about the change compared to information about the change compared to
on_lines. Return`true`to detach. Args: on_lines. Return `true` to detach. Args:
• the string "bytes" • the string "bytes"
• buffer handle • buffer handle
• b:changedtick • b:changedtick
@@ -2332,7 +2332,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
• hl_mode : control how highlights are combined • hl_mode : control how highlights are combined
with the highlights of the text. Currently with the highlights of the text. Currently
only affects virt_text highlights, but might only affects virt_text highlights, but might
affect`hl_group`in later versions. affect `hl_group` in later versions.
• "replace": only show the virt_text color. • "replace": only show the virt_text color.
This is the default This is the default
• "combine": combine with background text • "combine": combine with background text
@@ -2742,28 +2742,29 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
{buffer} Buffer to display, or 0 for current buffer {buffer} Buffer to display, or 0 for current buffer
{enter} Enter the window (make it the current window) {enter} Enter the window (make it the current window)
{config} Map defining the window configuration. Keys: {config} Map defining the window configuration. Keys:
`relative`: Sets the window layout to "floating", placed • relative: Sets the window layout to
at (row,col) coordinates relative to: "floating", placed at (row,col) coordinates
relative to:
• "editor" The global editor grid • "editor" The global editor grid
• "win" Window given by the `win` field, or • "win" Window given by the `win` field, or
current window. current window.
• "cursor" Cursor position in current window. • "cursor" Cursor position in current window.
`win` : |window-ID| for relative="win". • win: |window-ID| for relative="win".
`anchor`: Decides which corner of the float to place • anchor: Decides which corner of the float to
at (row,col): place at (row,col):
• "NW" northwest (default) • "NW" northwest (default)
• "NE" northeast • "NE" northeast
• "SW" southwest • "SW" southwest
• "SE" southeast • "SE" southeast
`width` : Window width (in character cells). • width: Window width (in character cells).
Minimum of 1. Minimum of 1.
`height` : Window height (in character cells). • height: Window height (in character cells).
Minimum of 1. Minimum of 1.
`bufpos`: Places float relative to buffer text (only • bufpos: Places float relative to buffer text
when relative="win"). Takes a tuple of (only when relative="win"). Takes a tuple of
zero-indexed [line, column].`row`and`col`if given are applied relative to this zero-indexed [line, column]. `row` and `col` if given are applied relative to this
position, else they default to: position, else they default to:
• `row=1` and `col=0` if `anchor` is "NW" or • `row=1` and `col=0` if `anchor` is "NW" or
"NE" "NE"
@@ -2771,19 +2772,19 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
"SE" (thus like a tooltip near the buffer "SE" (thus like a tooltip near the buffer
text). text).
`row` : Row position in units of "screen cell • row: Row position in units of "screen cell
height", may be fractional. height", may be fractional.
`col` : Column position in units of "screen • col: Column position in units of "screen cell
cell width", may be fractional. width", may be fractional.
`focusable` : Enable focus by user actions • focusable: Enable focus by user actions
(wincmds, mouse events). Defaults to true. (wincmds, mouse events). Defaults to true.
Non-focusable windows can be entered by Non-focusable windows can be entered by
|nvim_set_current_win()|. |nvim_set_current_win()|.
`external` : GUI should display the window as • external: GUI should display the window as an
an external top-level window. Currently external top-level window. Currently accepts
accepts no other positioning configuration no other positioning configuration together
together with this. with this.
`zindex`: Stacking order. floats with higher`zindex`go on top on floats with lower indices. Must • zindex: Stacking order. floats with higher `zindex` go on top on floats with lower indices. Must
be larger than zero. The following screen be larger than zero. The following screen
elements have hard-coded z-indices: elements have hard-coded z-indices:
• 100: insert completion popupmenu • 100: insert completion popupmenu
@@ -2794,7 +2795,7 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
are recommended, unless there is a good are recommended, unless there is a good
reason to overshadow builtin elements. reason to overshadow builtin elements.
`style`: Configure the appearance of the window. • style: Configure the appearance of the window.
Currently only takes one non-empty value: Currently only takes one non-empty value:
• "minimal" Nvim will display the window with • "minimal" Nvim will display the window with
many UI options disabled. This is useful many UI options disabled. This is useful
@@ -2809,9 +2810,9 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
and clearing the |EndOfBuffer| region in and clearing the |EndOfBuffer| region in
'winhighlight'. 'winhighlight'.
`border`: Style of (optional) window border. This can • border: Style of (optional) window border.
either be a string or an array. The string This can either be a string or an array. The
values are string values are
• "none": No border (default). • "none": No border (default).
• "single": A single line box. • "single": A single line box.
• "double": A double line box. • "double": A double line box.
@@ -2841,7 +2842,7 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
It could also be specified by character: [ It could also be specified by character: [
{"+", "MyCorner"}, {"x", "MyBorder"} ]. {"+", "MyCorner"}, {"x", "MyBorder"} ].
`noautocmd` : If true then no buffer-related • noautocmd: If true then no buffer-related
autocommand events such as |BufEnter|, autocommand events such as |BufEnter|,
|BufLeave| or |BufWinEnter| may fire from |BufLeave| or |BufWinEnter| may fire from
calling this function. calling this function.

View File

@@ -670,7 +670,7 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()*
{base} If findstart=0, text to match against {base} If findstart=0, text to match against
Return: ~ Return: ~
(number) Decided by`findstart`: (number) Decided by {findstart}:
• findstart=0: column where the completion starts, or -2 • findstart=0: column where the completion starts, or -2
or -3 or -3
• findstart=1: list of matches (actually just calls • findstart=1: list of matches (actually just calls

View File

@@ -1518,7 +1518,7 @@ tbl_flatten({t}) *vim.tbl_flatten()*
Flattened copy of the given list-like table. Flattened copy of the given list-like table.
See also: ~ See also: ~
Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua From https://github.com/premake/premake-core/blob/master/src/base/table.lua
tbl_isempty({t}) *vim.tbl_isempty()* tbl_isempty({t}) *vim.tbl_isempty()*
Checks if a table is empty. Checks if a table is empty.
@@ -1554,7 +1554,7 @@ tbl_keys({t}) *vim.tbl_keys()*
list of keys list of keys
See also: ~ See also: ~
Fromhttps://github.com/premake/premake-core/blob/master/src/base/table.lua From https://github.com/premake/premake-core/blob/master/src/base/table.lua
tbl_map({func}, {t}) *vim.tbl_map()* tbl_map({func}, {t}) *vim.tbl_map()*
Apply a function to all values of a table. Apply a function to all values of a table.

View File

@@ -1430,7 +1430,7 @@ end
---@param findstart 0 or 1, decides behavior ---@param findstart 0 or 1, decides behavior
---@param base If findstart=0, text to match against ---@param base If findstart=0, text to match against
--- ---
---@returns (number) Decided by `findstart`: ---@returns (number) Decided by {findstart}:
--- - findstart=0: column where the completion starts, or -2 or -3 --- - findstart=0: column where the completion starts, or -2 or -3
--- - findstart=1: list of matches (actually just calls |complete()|) --- - findstart=1: list of matches (actually just calls |complete()|)
function lsp.omnifunc(findstart, base) function lsp.omnifunc(findstart, base)

View File

@@ -506,6 +506,11 @@ def render_node(n, text, prefix='', indent='', width=62):
text += indent + prefix + result text += indent + prefix + result
elif n.nodeName in ('para', 'heading'): elif n.nodeName in ('para', 'heading'):
for c in n.childNodes: for c in n.childNodes:
if (is_inline(c)
and '' != get_text(c).strip()
and text
and ' ' != text[-1]):
text += ' '
text += render_node(c, text, indent=indent, width=width) text += render_node(c, text, indent=indent, width=width)
elif n.nodeName == 'itemizedlist': elif n.nodeName == 'itemizedlist':
for c in n.childNodes: for c in n.childNodes:

View File

@@ -61,36 +61,36 @@
/// @param buffer Buffer to display, or 0 for current buffer /// @param buffer Buffer to display, or 0 for current buffer
/// @param enter Enter the window (make it the current window) /// @param enter Enter the window (make it the current window)
/// @param config Map defining the window configuration. Keys: /// @param config Map defining the window configuration. Keys:
/// - `relative`: Sets the window layout to "floating", placed at (row,col) /// - relative: Sets the window layout to "floating", placed at (row,col)
/// coordinates relative to: /// coordinates relative to:
/// - "editor" The global editor grid /// - "editor" The global editor grid
/// - "win" Window given by the `win` field, or current window. /// - "win" Window given by the `win` field, or current window.
/// - "cursor" Cursor position in current window. /// - "cursor" Cursor position in current window.
/// - `win`: |window-ID| for relative="win". /// - win: |window-ID| for relative="win".
/// - `anchor`: Decides which corner of the float to place at (row,col): /// - anchor: Decides which corner of the float to place at (row,col):
/// - "NW" northwest (default) /// - "NW" northwest (default)
/// - "NE" northeast /// - "NE" northeast
/// - "SW" southwest /// - "SW" southwest
/// - "SE" southeast /// - "SE" southeast
/// - `width`: Window width (in character cells). Minimum of 1. /// - width: Window width (in character cells). Minimum of 1.
/// - `height`: Window height (in character cells). Minimum of 1. /// - height: Window height (in character cells). Minimum of 1.
/// - `bufpos`: Places float relative to buffer text (only when /// - bufpos: Places float relative to buffer text (only when
/// relative="win"). Takes a tuple of zero-indexed [line, column]. /// relative="win"). Takes a tuple of zero-indexed [line, column].
/// `row` and `col` if given are applied relative to this /// `row` and `col` if given are applied relative to this
/// position, else they default to: /// position, else they default to:
/// - `row=1` and `col=0` if `anchor` is "NW" or "NE" /// - `row=1` and `col=0` if `anchor` is "NW" or "NE"
/// - `row=0` and `col=0` if `anchor` is "SW" or "SE" /// - `row=0` and `col=0` if `anchor` is "SW" or "SE"
/// (thus like a tooltip near the buffer text). /// (thus like a tooltip near the buffer text).
/// - `row`: Row position in units of "screen cell height", may be fractional. /// - row: Row position in units of "screen cell height", may be fractional.
/// - `col`: Column position in units of "screen cell width", may be /// - col: Column position in units of "screen cell width", may be
/// fractional. /// fractional.
/// - `focusable`: Enable focus by user actions (wincmds, mouse events). /// - focusable: Enable focus by user actions (wincmds, mouse events).
/// Defaults to true. Non-focusable windows can be entered by /// Defaults to true. Non-focusable windows can be entered by
/// |nvim_set_current_win()|. /// |nvim_set_current_win()|.
/// - `external`: GUI should display the window as an external /// - external: GUI should display the window as an external
/// top-level window. Currently accepts no other positioning /// top-level window. Currently accepts no other positioning
/// configuration together with this. /// configuration together with this.
/// - `zindex`: Stacking order. floats with higher `zindex` go on top on /// - zindex: Stacking order. floats with higher `zindex` go on top on
/// floats with lower indices. Must be larger than zero. The /// floats with lower indices. Must be larger than zero. The
/// following screen elements have hard-coded z-indices: /// following screen elements have hard-coded z-indices:
/// - 100: insert completion popupmenu /// - 100: insert completion popupmenu
@@ -99,7 +99,7 @@
/// The default value for floats are 50. In general, values below 100 are /// The default value for floats are 50. In general, values below 100 are
/// recommended, unless there is a good reason to overshadow builtin /// recommended, unless there is a good reason to overshadow builtin
/// elements. /// elements.
/// - `style`: Configure the appearance of the window. Currently only takes /// - style: Configure the appearance of the window. Currently only takes
/// one non-empty value: /// one non-empty value:
/// - "minimal" Nvim will display the window with many UI options /// - "minimal" Nvim will display the window with many UI options
/// disabled. This is useful when displaying a temporary /// disabled. This is useful when displaying a temporary
@@ -110,7 +110,7 @@
/// end-of-buffer region is hidden by setting `eob` flag of /// end-of-buffer region is hidden by setting `eob` flag of
/// 'fillchars' to a space char, and clearing the /// 'fillchars' to a space char, and clearing the
/// |EndOfBuffer| region in 'winhighlight'. /// |EndOfBuffer| region in 'winhighlight'.
/// - `border`: Style of (optional) window border. This can either be a string /// - border: Style of (optional) window border. This can either be a string
/// or an array. The string values are /// or an array. The string values are
/// - "none": No border (default). /// - "none": No border (default).
/// - "single": A single line box. /// - "single": A single line box.
@@ -134,7 +134,7 @@
/// By default, `FloatBorder` highlight is used, which links to `VertSplit` /// By default, `FloatBorder` highlight is used, which links to `VertSplit`
/// when not defined. It could also be specified by character: /// when not defined. It could also be specified by character:
/// [ {"+", "MyCorner"}, {"x", "MyBorder"} ]. /// [ {"+", "MyCorner"}, {"x", "MyBorder"} ].
/// - `noautocmd`: If true then no buffer-related autocommand events such as /// - noautocmd: If true then no buffer-related autocommand events such as
/// |BufEnter|, |BufLeave| or |BufWinEnter| may fire from /// |BufEnter|, |BufLeave| or |BufWinEnter| may fire from
/// calling this function. /// calling this function.
/// ///