aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/hl.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2025-06-05 11:31:51 +0100
committerLewis Russell <me@lewisr.dev>2025-06-06 15:36:48 +0100
commit3b6084ddf4f0d49fb0e5d135919c9daacea2a46d (patch)
treec46454da48ec05e345c953f4e172e52dff8bef52 /runtime/lua/vim/hl.lua
parent4c333fdbb7bee299f36624b429f5c065470e421d (diff)
downloadrneovim-3b6084ddf4f0d49fb0e5d135919c9daacea2a46d.tar.gz
rneovim-3b6084ddf4f0d49fb0e5d135919c9daacea2a46d.tar.bz2
rneovim-3b6084ddf4f0d49fb0e5d135919c9daacea2a46d.zip
fix: type fixes
Type fixes caught by emmylua
Diffstat (limited to 'runtime/lua/vim/hl.lua')
-rw-r--r--runtime/lua/vim/hl.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/lua/vim/hl.lua b/runtime/lua/vim/hl.lua
index 50345d1dc7..d486984b7c 100644
--- a/runtime/lua/vim/hl.lua
+++ b/runtime/lua/vim/hl.lua
@@ -41,8 +41,8 @@ M.priorities = {
---@param bufnr integer Buffer number to apply highlighting to
---@param ns integer Namespace to add highlight to
---@param higroup string Highlight group to use for highlighting
----@param start integer[]|string Start of region as a (line, column) tuple or string accepted by |getpos()|
----@param finish integer[]|string End of region as a (line, column) tuple or string accepted by |getpos()|
+---@param start [integer,integer]|string Start of region as a (line, column) tuple or string accepted by |getpos()|
+---@param finish [integer,integer]|string End of region as a (line, column) tuple or string accepted by |getpos()|
---@param opts? vim.hl.range.Opts
--- @return uv.uv_timer_t? range_timer A timer which manages how much time the
--- highlight has left
@@ -98,14 +98,16 @@ function M.range(bufnr, ns, higroup, start, finish, opts)
})
-- For non-blockwise selection, use a single extmark.
if regtype == 'v' or regtype == 'V' then
- region = { { region[1][1], region[#region][2] } }
+ --- @type [ [integer, integer, integer, integer], [integer, integer, integer, integer]][]
+ region = { { assert(region[1])[1], assert(region[#region])[2] } }
+ local region1 = assert(region[1])
if
regtype == 'V'
- or region[1][2][2] == pos1[2] and pos1[3] == v_maxcol
- or region[1][2][2] == pos2[2] and pos2[3] == v_maxcol
+ or region1[2][2] == pos1[2] and pos1[3] == v_maxcol
+ or region1[2][2] == pos2[2] and pos2[3] == v_maxcol
then
- region[1][2][2] = region[1][2][2] + 1
- region[1][2][3] = 0
+ region1[2][2] = region1[2][2] + 1
+ region1[2][3] = 0
end
end