Skip to content

Commit

Permalink
fix(keys): operator pending mode
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 3, 2023
1 parent 2e3e65b commit e93f50f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/lazy/core/handler/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ function M.retrigger(keys)
pending = pending .. c
end
local op = vim.v.operator
if op and op ~= "" then
if op and op ~= "" and vim.api.nvim_get_mode().mode:find("o") then
keys = "<esc>" .. op .. keys
end
local feed = vim.api.nvim_replace_termcodes(keys, true, false, true) .. pending
local feed = vim.api.nvim_replace_termcodes(keys, true, true, true) .. pending
if vim.v.count ~= 0 then
feed = vim.v.count .. feed
end
vim.api.nvim_feedkeys(feed, "m", false)
vim.api.nvim_input(feed)
end

---@param value string|LazyKeys
Expand Down Expand Up @@ -75,7 +75,6 @@ function M:_add(value)
local keys = M.parse(value)
local lhs = keys[1]
local opts = M.opts(keys)
opts.noremap = true
vim.keymap.set(keys.mode, lhs, function()
local key = self:key(value)
local plugins = self.active[key]
Expand Down

0 comments on commit e93f50f

Please sign in to comment.