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

fix: apply on_filetype in VISUAL mode inc/dec #71

Merged
merged 1 commit into from Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions lua/dial/command.lua
Expand Up @@ -41,12 +41,17 @@ end
---Select the most appropriate augend from given augend group (in VISUAL mode).
---@param group_name? string
function M.select_augend_visual(group_name)
if group_name == nil and vim.v.register == "=" then
local augends
if group_name ~= nil then
augends = config.augends.group[group_name]
elseif vim.v.register == "=" then
group_name = vim.fn.getreg("=", 1)
augends = config.augends.group[group_name]
elseif config.augends.filetype[vim.bo.filetype] ~= nil then
augends = config.augends.filetype[vim.bo.filetype]
else
group_name = util.unwrap_or(group_name, "default")
augends = config.augends.group["default"]
end
local augends = config.augends.group[group_name]
if augends == nil then
error(("undefined augend group name: %s"):format(group_name))
end
Expand Down