Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use return in a loop #30

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions lua/nvim-paredit/utils/keybindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,25 @@ end

function M.setup_keybindings(opts)
for keymap, action in pairs(opts.keys) do
if not action then
return
end
if action then
local repeatable = true
if type(action.repeatable) == "boolean" then
repeatable = action.repeatable
end

local repeatable = true
if type(action.repeatable) == "boolean" then
repeatable = action.repeatable
end
local fn = action[1]
if repeatable then
fn = M.with_repeat(fn)
end

local fn = action[1]
if repeatable then
fn = M.with_repeat(fn)
vim.keymap.set(action.mode or { "n", "x" }, keymap, fn, {
desc = action[2],
buffer = opts.buf or 0,
expr = repeatable,
remap = false,
silent = true,
})
end

vim.keymap.set(action.mode or { "n", "x" }, keymap, fn, {
desc = action[2],
buffer = opts.buf or 0,
expr = repeatable,
remap = false,
silent = true,
})
end
end

Expand Down
Loading