mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
fix(dial): Fix dial commands in Visual line+block (#2933)
This commit is contained in:
parent
3585d61c93
commit
1df3c5d70b
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue