mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	docs(lua): number → integer (#22517)
This commit is contained in:
		| @@ -1413,7 +1413,7 @@ notify({msg}, {level}, {opts})                                  *vim.notify()* | |||||||
|  |  | ||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {msg}    (string) Content of the notification to show to the user. |       • {msg}    (string) Content of the notification to show to the user. | ||||||
|       • {level}  (number|nil) One of the values from |vim.log.levels|. |       • {level}  (integer|nil) One of the values from |vim.log.levels|. | ||||||
|       • {opts}   (table|nil) Optional parameters. Unused by default. |       • {opts}   (table|nil) Optional parameters. Unused by default. | ||||||
|  |  | ||||||
| notify_once({msg}, {level}, {opts})                        *vim.notify_once()* | notify_once({msg}, {level}, {opts})                        *vim.notify_once()* | ||||||
| @@ -1424,7 +1424,7 @@ notify_once({msg}, {level}, {opts})                        *vim.notify_once()* | |||||||
|  |  | ||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {msg}    (string) Content of the notification to show to the user. |       • {msg}    (string) Content of the notification to show to the user. | ||||||
|       • {level}  (number|nil) One of the values from |vim.log.levels|. |       • {level}  (integer|nil) One of the values from |vim.log.levels|. | ||||||
|       • {opts}   (table|nil) Optional parameters. Unused by default. |       • {opts}   (table|nil) Optional parameters. Unused by default. | ||||||
|  |  | ||||||
|     Return: ~ |     Return: ~ | ||||||
| @@ -1448,11 +1448,11 @@ on_key({fn}, {ns_id})                                           *vim.on_key()* | |||||||
|                  argument. On each key press, Nvim passes the key char to |                  argument. On each key press, Nvim passes the key char to | ||||||
|                  fn(). |i_CTRL-V| If {fn} is nil, it removes the callback for |                  fn(). |i_CTRL-V| If {fn} is nil, it removes the callback for | ||||||
|                  the associated {ns_id} |                  the associated {ns_id} | ||||||
|       • {ns_id}  number? Namespace ID. If nil or 0, generates and returns a |       • {ns_id}  integer? Namespace ID. If nil or 0, generates and returns a | ||||||
|                  new |nvim_create_namespace()| id. |                  new |nvim_create_namespace()| id. | ||||||
|  |  | ||||||
|     Return: ~ |     Return: ~ | ||||||
|         (number) Namespace id associated with {fn}. Or count of all callbacks |         (integer) Namespace id associated with {fn}. Or count of all callbacks | ||||||
|         if on_key() is called without arguments. |         if on_key() is called without arguments. | ||||||
|  |  | ||||||
|     Note: |     Note: | ||||||
| @@ -1507,7 +1507,7 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive})         *vim.region()* | |||||||
|     points |     points | ||||||
|  |  | ||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {bufnr}      (number) of buffer |       • {bufnr}      (integer) number of buffer | ||||||
|       • {pos1}       integer[] (line, column) tuple marking beginning of |       • {pos1}       integer[] (line, column) tuple marking beginning of | ||||||
|                      region |                      region | ||||||
|       • {pos2}       integer[] (line, column) tuple marking end of region |       • {pos2}       integer[] (line, column) tuple marking end of region | ||||||
| @@ -1678,8 +1678,8 @@ list_extend({dst}, {src}, {start}, {finish})               *vim.list_extend()* | |||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {dst}     (table) List which will be modified and appended to |       • {dst}     (table) List which will be modified and appended to | ||||||
|       • {src}     (table) List from which values will be inserted |       • {src}     (table) List from which values will be inserted | ||||||
|       • {start}   (number|nil) Start index on src. Defaults to 1 |       • {start}   (integer|nil) Start index on src. Defaults to 1 | ||||||
|       • {finish}  (number|nil) Final index on src. Defaults to `#src` |       • {finish}  (integer|nil) Final index on src. Defaults to `#src` | ||||||
|  |  | ||||||
|     Return: ~ |     Return: ~ | ||||||
|         (table) dst |         (table) dst | ||||||
| @@ -1693,8 +1693,8 @@ list_slice({list}, {start}, {finish})                       *vim.list_slice()* | |||||||
|  |  | ||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {list}    (list) Table |       • {list}    (list) Table | ||||||
|       • {start}   (number|nil) Start range of slice |       • {start}   (integer|nil) Start range of slice | ||||||
|       • {finish}  (number|nil) End range of slice |       • {finish}  (integer|nil) End range of slice | ||||||
|  |  | ||||||
|     Return: ~ |     Return: ~ | ||||||
|         (list) Copy of table sliced from start to finish (inclusive) |         (list) Copy of table sliced from start to finish (inclusive) | ||||||
| @@ -1794,7 +1794,7 @@ tbl_count({t})                                               *vim.tbl_count()* | |||||||
|       • {t}  (table) Table |       • {t}  (table) Table | ||||||
|  |  | ||||||
|     Return: ~ |     Return: ~ | ||||||
|         (number) Number of non-nil values in table |         (integer) Number of non-nil values in table | ||||||
|  |  | ||||||
|     See also: ~ |     See also: ~ | ||||||
|         https://github.com/Tieske/Penlight/blob/master/lua/pl/tablex.lua |         https://github.com/Tieske/Penlight/blob/master/lua/pl/tablex.lua | ||||||
|   | |||||||
| @@ -386,7 +386,7 @@ end | |||||||
|  |  | ||||||
| --- Get a table of lines with start, end columns for a region marked by two points | --- Get a table of lines with start, end columns for a region marked by two points | ||||||
| --- | --- | ||||||
| ---@param bufnr number of buffer | ---@param bufnr integer number of buffer | ||||||
| ---@param pos1 integer[] (line, column) tuple marking beginning of region | ---@param pos1 integer[] (line, column) tuple marking beginning of region | ||||||
| ---@param pos2 integer[] (line, column) tuple marking end of region | ---@param pos2 integer[] (line, column) tuple marking end of region | ||||||
| ---@param regtype string type of selection, see |setreg()| | ---@param regtype string type of selection, see |setreg()| | ||||||
| @@ -471,7 +471,7 @@ end | |||||||
| --- writes to |:messages|. | --- writes to |:messages|. | ||||||
| --- | --- | ||||||
| ---@param msg string Content of the notification to show to the user. | ---@param msg string Content of the notification to show to the user. | ||||||
| ---@param level number|nil One of the values from |vim.log.levels|. | ---@param level integer|nil One of the values from |vim.log.levels|. | ||||||
| ---@param opts table|nil Optional parameters. Unused by default. | ---@param opts table|nil Optional parameters. Unused by default. | ||||||
| function vim.notify(msg, level, opts) -- luacheck: no unused args | function vim.notify(msg, level, opts) -- luacheck: no unused args | ||||||
|   if level == vim.log.levels.ERROR then |   if level == vim.log.levels.ERROR then | ||||||
| @@ -492,7 +492,7 @@ do | |||||||
|   --- display a notification. |   --- display a notification. | ||||||
|   --- |   --- | ||||||
|   ---@param msg string Content of the notification to show to the user. |   ---@param msg string Content of the notification to show to the user. | ||||||
|   ---@param level number|nil One of the values from |vim.log.levels|. |   ---@param level integer|nil One of the values from |vim.log.levels|. | ||||||
|   ---@param opts table|nil Optional parameters. Unused by default. |   ---@param opts table|nil Optional parameters. Unused by default. | ||||||
|   ---@return boolean true if message was displayed, else false |   ---@return boolean true if message was displayed, else false | ||||||
|   function vim.notify_once(msg, level, opts) |   function vim.notify_once(msg, level, opts) | ||||||
| @@ -521,10 +521,10 @@ local on_key_cbs = {} | |||||||
| ---@param fn function: Callback function. It should take one string argument. | ---@param fn function: Callback function. It should take one string argument. | ||||||
| ---                   On each key press, Nvim passes the key char to fn(). |i_CTRL-V| | ---                   On each key press, Nvim passes the key char to fn(). |i_CTRL-V| | ||||||
| ---                   If {fn} is nil, it removes the callback for the associated {ns_id} | ---                   If {fn} is nil, it removes the callback for the associated {ns_id} | ||||||
| ---@param ns_id number? Namespace ID. If nil or 0, generates and returns a new | ---@param ns_id integer? Namespace ID. If nil or 0, generates and returns a new | ||||||
| ---                    |nvim_create_namespace()| id. | ---                    |nvim_create_namespace()| id. | ||||||
| --- | --- | ||||||
| ---@return number Namespace id associated with {fn}. Or count of all callbacks | ---@return integer Namespace id associated with {fn}. Or count of all callbacks | ||||||
| ---if on_key() is called without arguments. | ---if on_key() is called without arguments. | ||||||
| --- | --- | ||||||
| ---@note {fn} will be removed if an error occurs while calling. | ---@note {fn} will be removed if an error occurs while calling. | ||||||
|   | |||||||
| @@ -418,8 +418,8 @@ end | |||||||
| ---@generic T: table | ---@generic T: table | ||||||
| ---@param dst T List which will be modified and appended to | ---@param dst T List which will be modified and appended to | ||||||
| ---@param src table List from which values will be inserted | ---@param src table List from which values will be inserted | ||||||
| ---@param start (number|nil) Start index on src. Defaults to 1 | ---@param start (integer|nil) Start index on src. Defaults to 1 | ||||||
| ---@param finish (number|nil) Final index on src. Defaults to `#src` | ---@param finish (integer|nil) Final index on src. Defaults to `#src` | ||||||
| ---@return T dst | ---@return T dst | ||||||
| function vim.list_extend(dst, src, start, finish) | function vim.list_extend(dst, src, start, finish) | ||||||
|   vim.validate({ |   vim.validate({ | ||||||
| @@ -529,7 +529,7 @@ end | |||||||
| --- | --- | ||||||
| ---@see https://github.com/Tieske/Penlight/blob/master/lua/pl/tablex.lua | ---@see https://github.com/Tieske/Penlight/blob/master/lua/pl/tablex.lua | ||||||
| ---@param t table Table | ---@param t table Table | ||||||
| ---@return number Number of non-nil values in table | ---@return integer Number of non-nil values in table | ||||||
| function vim.tbl_count(t) | function vim.tbl_count(t) | ||||||
|   vim.validate({ t = { t, 't' } }) |   vim.validate({ t = { t, 't' } }) | ||||||
|  |  | ||||||
| @@ -544,8 +544,8 @@ end | |||||||
| --- | --- | ||||||
| ---@generic T | ---@generic T | ||||||
| ---@param list T[] (list) Table | ---@param list T[] (list) Table | ||||||
| ---@param start number|nil Start range of slice | ---@param start integer|nil Start range of slice | ||||||
| ---@param finish number|nil End range of slice | ---@param finish integer|nil End range of slice | ||||||
| ---@return T[] (list) Copy of table sliced from start to finish (inclusive) | ---@return T[] (list) Copy of table sliced from start to finish (inclusive) | ||||||
| function vim.list_slice(list, start, finish) | function vim.list_slice(list, start, finish) | ||||||
|   local new_list = {} |   local new_list = {} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jaehwang Jung
					Jaehwang Jung