Skip to content

Commit

Permalink
feat: add feed_with_count method
Browse files Browse the repository at this point in the history
  • Loading branch information
Wansmer committed Sep 14, 2024
1 parent 62cc28b commit cc89712
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/langmapper/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ function M.trans_list(list)
return trans_list
end

function M.feed_with_count(keys)
local modes = { 'c', 'o', 'i' } -- ignore count on this modes
local count = (vim.v.count == 0 or vim.tbl_contains(modes, vim.fn.mode())) and '' or vim.v.count
return count .. keys
end

---Remapping each CTRL+ sequence
function M._map_translated_ctrls()
local function remap_ctrl(list, from, to)
Expand Down

0 comments on commit cc89712

Please sign in to comment.