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: Introduced regression with key handling #308

Closed
3 tasks done
smhc opened this issue Jan 4, 2023 · 3 comments · Fixed by #312
Closed
3 tasks done

bug: Introduced regression with key handling #308

smhc opened this issue Jan 4, 2023 · 3 comments · Fixed by #312
Labels
bug Something isn't working

Comments

@smhc
Copy link

smhc commented Jan 4, 2023

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.0

Operating system/version

Linux

Describe the bug

Using a key binding to load plugin results in random register pastes instead of actual key press. See repro.lua.

Reverting this change fixes the issue: e93f50f

Steps To Reproduce

  1. see repro.lua

Expected Behavior

Key-binding should load plugin and forward key event normally (7.9.0 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)

-- install plugins
vim.keymap.set('n', '<Leader>e', '<Plug>(x-file-explorer)', { silent = true })
local M = {
  "nvim-neo-tree/neo-tree.nvim",
  branch = "v2.x",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "kyazdani42/nvim-web-devicons",
    "MunifTanjim/nui.nvim",
    "plenary.nvim",
    'nvim-web-devicons',
    'nui.nvim',
  },
  keys = {
    '<Plug>(x-file-explorer)',
  },
  config = function()
     vim.keymap.set('n', '<Plug>(x-file-explorer)', '<cmd>Neotree toggle<CR>', {})
  end
}
local plugins = {
    "folke/tokyonight.nvim",
    M
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
@smhc smhc added the bug Something isn't working label Jan 4, 2023
@smhc
Copy link
Author

smhc commented Jan 4, 2023

Duplicate of #307 that was raised while raising this issue.

@smhc
Copy link
Author

smhc commented Jan 4, 2023

There is this comment on nvim_input() API that is likely related:

   Note:
        |keycodes| like <CR> are translated, so "<" is special. To input a
        literal "<", send <LT>.

@folke folke closed this as completed in 507b695 Jan 4, 2023
@folke
Copy link
Owner

folke commented Jan 4, 2023

Should be fixed now. Do make sure you set your mapleader before loading lazy

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.

2 participants