Skip to content

Commit

Permalink
fix(dial): Fix dial commands in Visual line+block (#2933)
Browse files Browse the repository at this point in the history
  • Loading branch information
grddavies committed May 14, 2024
1 parent 3585d61 commit 1df3c5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/lazyvim/plugins/extras/editor/dial.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ M.dials_by_ft = {}
---@param increment boolean
---@param g? boolean
function M.dial(increment, g)
local is_visual = vim.fn.mode(true):sub(1, 1) == "v"
local mode = vim.fn.mode(true)
-- 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"
return require("dial.map")[func](group)
Expand Down

0 comments on commit 1df3c5d

Please sign in to comment.