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
change mapping into function-based interface #56
Conversation
Maybe you can use |
The count works fine for |
Hi @monaq any way I can help to get this merged? |
Thanks. I am currently considering what procedure would be preferable for the merge. |
Co-authored-by: monaqa <48883418+monaqa@users.noreply.github.com>
b794fd5
to
e77dfb2
Compare
To avoid breaking changes, instead of modifying the |
function M.manipulate(direction, mode, group_name, count) | ||
if count == nil then | ||
count = vim.v.count1 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the removal of apply_if_function
intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have decided it is not necessary because the evaluation of group_name can be delayed by the following:
vim.keymap.set("n", "<C-a>", function()
local group_name = evaluate_some_expr()
require("dial.map").manipulate("increment", "normal", group_name)
end)
This PR changes
require("dial.map").inc_normal
and others into function, which enables us to set group_name dynamically.To support count, maybe we have to break the existing interface.