fix(dials): dials.nvim stopped working after making changes to plugin files

This commit is contained in:
Folke Lemaitre
2024-07-03 19:06:43 +02:00
parent b9a8a4ad7f
commit 455557c1f6

View File

@ -1,6 +1,4 @@
local M = {}
---@type table<string, table<string, string[]>>
M.dials_by_ft = {}
---@param increment boolean
---@param g? boolean
@ -9,7 +7,7 @@ function M.dial(increment, g)
-- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22'
local is_visual = mode == "v" or mode == "V" or mode == "\22"
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
local group = M.dials_by_ft[vim.bo.filetype] or "default"
local group = vim.g.dials_by_ft[vim.bo.filetype] or "default"
return require("dial.map")[func](group)
end
@ -170,6 +168,6 @@ return {
end,
config = function(_, opts)
require("dial.config").augends:register_group(opts.groups)
M.dials_by_ft = opts.dials_by_ft
vim.g.dials_by_ft = opts.dials_by_ft
end,
}