Skip to content

Commit bd713b2

Browse files
ofseedclason
authored andcommitted
refactor(shared): better convertion function name
1 parent 18dcd1e commit bd713b2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lua/nvim-treesitter-textobjects/move.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ local function move(opts)
128128
end
129129
end
130130
end
131-
goto_node(best_range and shared.range6_range4(best_range), not best_start, not config.set_jumps)
131+
goto_node(best_range and shared.torange4(best_range), not best_start, not config.set_jumps)
132132
end
133133
end
134134

lua/nvim-treesitter-textobjects/select.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function M.select_textobject(query_string, query_group)
160160
{ lookahead = lookahead, lookbehind = lookbehind }
161161
)
162162
if range6 then
163-
local range4 = shared.range6_range4(range6)
163+
local range4 = shared.torange4(range6)
164164
local selection_mode = M.detect_selection_mode(query_string)
165165
if
166166
function_or_value_to_value(surrounding_whitespace, {

lua/nvim-treesitter-textobjects/shared.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ end
243243

244244
---@param range Range6
245245
---@return Range4
246-
function M.range6_range4(range)
246+
function M.torange4(range)
247247
return { range[1], range[2], range[4], range[5] }
248248
end
249249

@@ -269,7 +269,7 @@ local function best_range_at_point(ranges, row, col, opts)
269269
local lookbehind_earliest_start ---@type integer
270270

271271
for _, range in pairs(ranges) do
272-
if range and is_in_range(M.range6_range4(range), row, col) then
272+
if range and is_in_range(M.torange4(range), row, col) then
273273
local length = range[6] - range[3]
274274
if not range_length or length < range_length then
275275
smallest_range = range
@@ -380,7 +380,7 @@ function M.textobject_at_point(query_string, query_group, bufnr, pos, opts)
380380

381381
local ranges_within_outer = {}
382382
for _, range in ipairs(ranges) do
383-
if contains(M.range6_range4(range_outer), M.range6_range4(range)) then
383+
if contains(M.torange4(range_outer), M.torange4(range)) then
384384
table.insert(ranges_within_outer, range)
385385
end
386386
end

lua/nvim-treesitter-textobjects/swap.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ local function swap_textobject(captures, query_group, direction)
179179
local adjacent = direction > 0 and next_textobject(textobject_range, query_string, query_group, bufnr)
180180
or previous_textobject(textobject_range, query_string, query_group, bufnr)
181181
if adjacent then
182-
swap_nodes(shared.range6_range4(textobject_range), shared.range6_range4(adjacent), bufnr, "yes, set cursor!")
182+
swap_nodes(shared.torange4(textobject_range), shared.torange4(adjacent), bufnr, "yes, set cursor!")
183183
end
184184
end
185185
end

0 commit comments

Comments
 (0)