mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 09:19:43 +10: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:
8
runtime/lua/vim/_meta/vimfn.lua
generated
8
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -9573,7 +9573,7 @@ function vim.fn.str2nr(string, base) end
|
||||
--- Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
|
||||
---
|
||||
--- @param string string
|
||||
--- @return any
|
||||
--- @return integer
|
||||
function vim.fn.strcharlen(string) end
|
||||
|
||||
--- Like |strpart()| but using character index and length instead
|
||||
@@ -9593,8 +9593,8 @@ function vim.fn.strcharlen(string) end
|
||||
--- @param src string
|
||||
--- @param start integer
|
||||
--- @param len? integer
|
||||
--- @param skipcc? boolean
|
||||
--- @return any
|
||||
--- @param skipcc? 0|1|boolean
|
||||
--- @return string
|
||||
function vim.fn.strcharpart(src, start, len, skipcc) end
|
||||
|
||||
--- The result is a Number, which is the number of characters
|
||||
@@ -9626,7 +9626,7 @@ function vim.fn.strcharpart(src, start, len, skipcc) end
|
||||
--- <
|
||||
---
|
||||
--- @param string string
|
||||
--- @param skipcc? boolean
|
||||
--- @param skipcc? 0|1|boolean
|
||||
--- @return integer
|
||||
function vim.fn.strchars(string, skipcc) end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user