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: operator-mode mappings don't get retriggered correctly the first time. #286

Closed
3 tasks done
MurdeRM3L0DY opened this issue Jan 2, 2023 · 0 comments · Fixed by #281 or #428
Closed
3 tasks done

bug: operator-mode mappings don't get retriggered correctly the first time. #286

MurdeRM3L0DY opened this issue Jan 2, 2023 · 0 comments · Fixed by #281 or #428
Labels
bug Something isn't working

Comments

@MurdeRM3L0DY
Copy link
Contributor

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.9.0 commit 6ba34e2

Operating system/version

Linux

Describe the bug

trying to lazy load mini.ai with a and i mapped in operator-mode doesn't trigger correctly the first time.

Steps To Reproduce

  1. nvim -u repro.lua
  2. insert a word in insert mode for example "hello"
  3. go to normal mode and try to ciw
  4. you should see iw inserted before the cursor and you should be in insert mode
  5. the next time you try to ciw, it should work as expected

Expected Behavior

lazy-loading via operator-mode mappings should work as expected (unless this is expected behaviour???)

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify('./.repro', ':p')

-- set stdpaths to use .repro
for _, name in ipairs { 'config', 'data', 'state', 'cache' } do
  vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

-- bootstrap lazy
local lazypath = root .. '/plugins/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)

local plugins = {
  {
    'folke/tokyonight.nvim',
    config = function()
      vim.cmd.colorscheme 'tokyonight'
    end,
  },
  {
    'echasnovski/mini.ai',
    keys = {
      { 'a', mode = { 'x', 'o' } },
      { 'i', mode = { 'x', 'o' } },
    },
    config = function()
      require('mini.ai').setup {}
    end,
  },
}

require('lazy').setup(plugins, {
  root = root .. '/plugins',
})
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
1 participant