Skip to content

Commit

Permalink
luacheck fix
Browse files Browse the repository at this point in the history
goto_next_end fix
  • Loading branch information
kiyoon committed Jan 17, 2023
1 parent 0481c86 commit 61b690b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
40 changes: 34 additions & 6 deletions lua/nvim-treesitter/textobjects/move.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,51 @@ end
local move_repeatable = repeatable_move.make_repeatable_move(move)

M.goto_next_start = function(query_strings_regex, query_group)
move_repeatable { forward = true, start = true, query_strings_regex = query_strings_regex, query_group = query_group }
move_repeatable {
forward = true,
start = true,
query_strings_regex = query_strings_regex,
query_group = query_group,
}
end
M.goto_next_end = function(query_strings_regex, query_group)
move_repeatable { forward = true, start = true, query_strings_regex = query_strings_regex, query_group = query_group }
move_repeatable {
forward = true,
start = false,
query_strings_regex = query_strings_regex,
query_group = query_group,
}
end
M.goto_previous_start = function(query_strings_regex, query_group)
move_repeatable { forward = false, start = true, query_strings_regex = query_strings_regex, query_group = query_group }
move_repeatable {
forward = false,
start = true,
query_strings_regex = query_strings_regex,
query_group = query_group,
}
end
M.goto_previous_end = function(query_strings_regex, query_group)
move_repeatable { forward = false, start = false, query_strings_regex = query_strings_regex, query_group = query_group }
move_repeatable {
forward = false,
start = false,
query_strings_regex = query_strings_regex,
query_group = query_group,
}
end

M.goto_next = function(query_strings_regex, query_group)
move_repeatable { forward = true, query_strings_regex = query_strings_regex, query_group = query_group }
move_repeatable {
forward = true,
query_strings_regex = query_strings_regex,
query_group = query_group,
}
end
M.goto_previous = function(query_strings_regex, query_group)
move_repeatable { forward = false, query_strings_regex = query_strings_regex, query_group = query_group }
move_repeatable {
forward = false,
query_strings_regex = query_strings_regex,
query_group = query_group,
}
end

local nxo_mode_functions = {
Expand Down
3 changes: 2 additions & 1 deletion lua/nvim-treesitter/textobjects/repeatable_move.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ M.clear_last_move = function()
M.last_move = nil
end

-- move_fn's first argument must be a table of options, and it should include a `forward` boolean indicating whether to move forward (true) or backward (false)
-- move_fn's first argument must be a table of options, and it should include a `forward` boolean
-- indicating whether to move forward (true) or backward (false)
M.set_last_move = function(move_fn, opts, ...)
if type(move_fn) ~= "function" then
vim.notify(
Expand Down

0 comments on commit 61b690b

Please sign in to comment.