diff --git a/lua/ts_context_commentstring/utils.lua b/lua/ts_context_commentstring/utils.lua index b3b5f74..ab2229e 100644 --- a/lua/ts_context_commentstring/utils.lua +++ b/lua/ts_context_commentstring/utils.lua @@ -75,7 +75,7 @@ function M.get_cursor_line_non_whitespace_col_location() } end ----Get the location of the visual section start. +---Get the location of the visual selection start. --- ---@return ts_context_commentstring.Location function M.get_visual_start_location() @@ -87,6 +87,16 @@ function M.get_visual_start_location() } end +---Get the location of the visual selection end. +--- +---@return ts_context_commentstring.Location +function M.get_visual_end_location() + return { + vim.fn.getpos("'>")[2] - 1, + vim.fn.getpos("'>")[3] - 1, + } +end + ---Get the node that is on the given location (default first non-whitespace ---character of the cursor line). This also handles injected languages via ---language tree.