@@ -28,13 +28,17 @@ local function is_supported_ft()
28
28
return not unsupported_filetypes [ft ]
29
29
end
30
30
31
+ -- pipes follow a specific pattern of taking a node and always returning a
32
+ -- node: either the hopeful that it found, or the passed in original
31
33
--- @param node TSNode
32
34
--- @return TSNode
33
35
local function get_highest_coincident_pipe (node )
34
36
local candidate = nodes .get_highest_coincident (node )
35
37
return candidate or node
36
38
end
37
39
40
+ -- pipes follow a specific pattern of taking a node and always returning a
41
+ -- node: either the hopeful that it found, or the passed in original
38
42
--- @param node TSNode
39
43
--- @return TSNode
40
44
local function get_highest_string_node_pipe (node )
@@ -46,11 +50,8 @@ function M.swap_down()
46
50
if not is_on_target_node () then return end
47
51
if not is_supported_ft () then return end
48
52
49
- local target , row , line = targets .down ()
50
-
51
- if not target or not row or not line then
52
- return
53
- end
53
+ local target = targets .down ()
54
+ if not target then return end
54
55
55
56
local current = nodes .get_current ()
56
57
current = get_highest_coincident_pipe (current )
@@ -80,11 +81,8 @@ function M.swap_up()
80
81
if not is_on_target_node () then return end
81
82
if not is_supported_ft () then return end
82
83
83
- local target , row , line = targets .up ()
84
-
85
- if not target or not row or not line then
86
- return
87
- end
84
+ local target = targets .up ()
85
+ if not target then return end
88
86
89
87
local current = nodes .get_current ()
90
88
current = get_highest_coincident_pipe (current )
0 commit comments