Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: when a count is given to a key through which a module is triggered, the module gets loaded, but the count is forgotten #252

Closed
3 tasks done
medwatt opened this issue Dec 30, 2022 · 0 comments · Fixed by #251
Labels
bug Something isn't working

Comments

@medwatt
Copy link

medwatt commented Dec 30, 2022

Did you check docs and existing issues?

  • I have read all the lazy docs
  • I have searched the existing issues of lazy
  • I have searched the exsiting issues of the plugin I have a problem with

Neovim version (nvim -v)

0.8.1

Operating system/version

Linux

Describe the bug

I was contemplating whether this is a bug or this is a feature that is not supported, but ultimately decided to file it under bug since it can lead to unexpected behavior.

Say we have a plugin that that has a mapping <c-down> to select a word. Doing 5<c-down> selects 5 words. Suppose we want to lazy load this plugin. At the moment, doing something like keys = { { "<c-down>" } } in the plugin definition in lazy does indeed load the plugin, but forgets the count.

Steps To Reproduce

  1. Create 6 lines with text
  2. Position cursor on line 1, column 1
  3. Do 5<c-down>

Expected Behavior

Doing 5<c-down> should load the plugin and do 5<c-down>. However, at the moment, the plugin loads, but does <c-down>.

Repro

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)


require("lazy").setup {
    {
        'mg979/vim-visual-multi',
        keys = { { "<c-down>" } },
    },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant