Skip to content

Commit 2229142

Browse files
committed
Fix: refactor remnanets my eyes were bigger than my stomach on
1 parent 1f92b3e commit 2229142

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

lua/treewalker/movement.lua

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ end
1616

1717
---@return nil
1818
function M.move_in()
19-
local node = nodes.get_current()
20-
local target, row = targets.inn(node)
19+
local target, row = targets.inn()
2120
if not target or not row then return end
2221
vim.cmd("normal! m'")
2322
operations.jump(target, row)
@@ -27,7 +26,7 @@ end
2726
---@return nil
2827
function M.move_up()
2928
local node = nodes.get_current()
30-
local target, row = targets.up(node)
29+
local target, row = targets.up()
3130
if not target or not row then return end
3231

3332
-- No neighbor jumps in up
@@ -42,7 +41,7 @@ end
4241
---@return nil
4342
function M.move_down()
4443
local node = nodes.get_current()
45-
local target, row = targets.down(node)
44+
local target, row = targets.down()
4645
if not target or not row then return end
4746

4847
-- down needs neighbor before and after jump

lua/treewalker/targets.lua

+3-6
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ function M.out(node)
2424
return target, row
2525
end
2626

27-
---@param node TSNode
2827
---@return TSNode | nil, integer | nil
29-
function M.inn(node)
28+
function M.inn()
3029
local current_row, _, current_col = current()
3130

3231
local candidate, candidate_row =
@@ -35,9 +34,8 @@ function M.inn(node)
3534
return candidate, candidate_row
3635
end
3736

38-
---@param node TSNode
3937
---@return TSNode | nil, integer | nil
40-
function M.up(node)
38+
function M.up()
4139
local current_row, _, current_col = current()
4240

4341
-- Get next target if we're on an empty line
@@ -56,9 +54,8 @@ function M.up(node)
5654
end
5755
end
5856

59-
---@param node TSNode
6057
---@return TSNode | nil, integer | nil
61-
function M.down(node)
58+
function M.down()
6259
local current_row, _, current_col = current()
6360

6461
-- Get next target if we're on an empty line

0 commit comments

Comments
 (0)