folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
13.45k stars 322 forks source link

bug: Unexpected behaviour when press escape and j or k keys. #715

Closed othondev closed 1 year ago

othondev commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.8.2

Operating system/version

Ubuntu 20.04 ARM and MacBook Pro M1

Describe the bug

I believe there is an unexpected behavior or at least no standard nvim behavior when you accidentally type the escape key combined with the j or k keys. The same behavior didn't happen on the default nvim setup.

Please find the video describing the bug below

https://user-images.githubusercontent.com/28935584/229756119-70277572-5aab-4b43-a661-b2dd408af1bb.mov

Steps To Reproduce

  1. Open the Nvim
  2. Write some new distinct new lines.
  3. On your keyboard, type ESC and j or k at the same time.
  4. See sometimes the current line will move up or down.

Expected Behavior

Just the cursor should move instead the whole line.

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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
craigmac commented 1 year ago

Cannot reproduce with given repro text, and you are definitely not using the repro setup in your left-hand side, something is binding alt+j/k keys to move lines up/down, a common binding, and nothing to do with lazy.nvim.

othondev commented 1 year ago

Hey @craigmac, Thank you for taking the time to reply to me. I'm not using any extra setup just the template kindly supplied by JesseZomer

I found the lines that are causing it and I can ensure when I remove them the issue has not been observed anymore.

$HOME/.local/share/nvim/lazy/LazyVim/lua/lazyvim/config/keymaps.lua

image

Please find the video:

https://user-images.githubusercontent.com/28935584/230714643-4618efb5-0ef0-4f2d-8976-0b26aea1abd2.mov

I really appreciate any help.

delabere commented 1 year ago

I'm having the same issue as well 👀

folke commented 1 year ago

That's terminal config and/or tmux config. Search the LAzyVim repo for similar issues

delabere commented 1 year ago

Sorry @folke I wondered if you could elaborate on this a little bit? I haven't been able to find any similar issues and not sure what you mean other than that by searching the repo. Deleting those lines didn't work for me either unfortunately.

othondev commented 11 months ago

I can confirm that issue disappears when I'm not running the lazynvim inside the tmux and doesn't matter if is the default or custom tmux.config.