mirror of
https://github.com/neovim/neovim.git
synced 2026-03-31 12:52:13 +00:00
docs(eval): fix fn.strchar types #37737
Problem: The following strchar functions have incorrect types: strcharlen() - Currently any. Always returns an integer, including on error strcharpart() - The skipcc annotation does not specify that 0 and 1 are valid. These inputs are required for vimscript usage. The current return type is any, even though the function returns an empty string on error strchars() - The skipcc annotation does not specify that 0 and 1 are valid Solution: Update the problem types.
This commit is contained in:
@@ -11532,6 +11532,7 @@ M.funcs = {
|
||||
]=],
|
||||
name = 'strcharlen',
|
||||
params = { { 'string', 'string' } },
|
||||
returns = 'integer',
|
||||
signature = 'strcharlen({string})',
|
||||
},
|
||||
strcharpart = {
|
||||
@@ -11559,8 +11560,9 @@ M.funcs = {
|
||||
{ 'src', 'string' },
|
||||
{ 'start', 'integer' },
|
||||
{ 'len', 'integer' },
|
||||
{ 'skipcc', 'boolean' },
|
||||
{ 'skipcc', '0|1|boolean' },
|
||||
},
|
||||
returns = 'string',
|
||||
signature = 'strcharpart({src}, {start} [, {len} [, {skipcc}]])',
|
||||
},
|
||||
strchars = {
|
||||
@@ -11596,7 +11598,7 @@ M.funcs = {
|
||||
<
|
||||
]=],
|
||||
name = 'strchars',
|
||||
params = { { 'string', 'string' }, { 'skipcc', 'boolean' } },
|
||||
params = { { 'string', 'string' }, { 'skipcc', '0|1|boolean' } },
|
||||
returns = 'integer',
|
||||
signature = 'strchars({string} [, {skipcc}])',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user