vim-debugstring icon indicating copy to clipboard operation
vim-debugstring copied to clipboard

vim-debugstring does not repeat with NeoVim and packer.nvim

Open andrewferrier opened this issue 3 years ago • 1 comments

Hi - I've been using vim-debugstring for some years now (we actually met at VimConf in London!) with Vim and more recently NeoVim.

I use vim-debugstring fairly regularly. However, fairly recently I've noticed that dot-repeat (.) has stopped working with vim-debugstring.

To be clear, vim-repeat is installed. For reference, this is how the relevant section of my packer.nvim config looks:

use({
    "bergercookie/vim-debugstring",
    requires = { "tpope/vim-repeat" },
    config = function()
        require("plugins.debugstring")
    end,
}) -- dq

I think I understand the issue though. These lines:

  • https://github.com/bergercookie/vim-debugstring/blob/5fad4c0fa5d93db9cbb62e87c847e7bebcd7716f/plugin/debugstring.vim#L168
  • https://github.com/bergercookie/vim-debugstring/blob/5fad4c0fa5d93db9cbb62e87c847e7bebcd7716f/plugin/debugstring.vim#L195

... specifically look for vim-repeat in the runtimepath variable. However, they aren't there, because they are implicitly there through the use of wildcards:

runtimepath=~/.config/nvim,~/.config/nvim/pack/*/start/*,/etc/xdg/nvim,~/.local/share/nvim/site,~/.local/share/nvim/site/pack/packer/o
pt/packer.nvim,~/.local/share/nvim/site/pack/*/start/*,/usr/local/share/nvim/site,/usr/share/nvim/site,~/.local/share/nvenv/versions/nig
htly/share/nvim/runtime,~/.local/share/nvenv/versions/nightly/share/nvim/runtime/pack/dist/opt/matchit,~/.local/share/nvenv/versions/nig
htly/lib/nvim,~/.local/share/nvim/site/pack/*/start/*/after,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,~/.local/share/n
vim/site/after,/etc/xdg/nvim/after,~/.config/nvim/after

In my case, vim-repeat ends up in ~/.local/share/nvim/site/pack/packer/start/vim-repeat/. It's there, but vim-debugstring doesn't detect it. If I comment out the if guards that check for its existence, repeat goes back to working.

I'm not sure of the right way to fix this, but it seems like the check for vim-repeat is too naive. I assume this problem could/would occur with Vim as well as NeoVim, maybe it just depends how a plugin manager populates runtimepath. I don't think packer.nvim touches it, so it's just the default value.

andrewferrier avatar Jun 28 '22 19:06 andrewferrier

For anyone else with the same problem, as a temporary workaround I am explicitly adding vim-repeat to my runtimepath for vim-debugstring to find:

vim.opt.runtimepath:append(
    vim.fn.stdpath("data") .. "/site/pack/packer/start/vim-repeat"
)

andrewferrier avatar Jun 28 '22 19:06 andrewferrier