numToStr / Navigator.nvim

:sparkles: Smoothly navigate between neovim and terminal multiplexer(s) :sparkles:
MIT License
391 stars 21 forks source link

Cannot move to splits/panes #2

Closed ruifm closed 3 years ago

ruifm commented 3 years ago

Setup

-- Configuration
require('Navigator').setup({
    auto_save = 'current',
    disable_on_zoom = true
})

-- Keybindings
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }

map('n', "<c-h>", "<CMD>lua require('Navigator').left()<CR>", opts)
map('n', "<c-k>", "<CMD>lua require('Navigator').up()<CR>", opts)
map('n', "<c-l>", "<CMD>lua require('Navigator').right()<CR>", opts)
map('n', "<c-j>", "<CMD>lua require('Navigator').down()<CR>", opts)
map('n', "<c-p>", "<CMD>lua require('Navigator').previous()<CR>", opts)
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'

set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux/plugins'
if "test ! -d ~/.local/share/tmux/plugins/tpm" \
   "run 'git clone https://github.com/tmux-plugins/tpm ~/.local/share/tmux/plugins/tpm && ~/.local/share/tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.local/share/tmux/plugins/tpm/tpm'
NVIM v0.5.0-dev+1226-g370469be2
Build type: RelWithDebInfo
LuaJIT 2.0.5

Issue description

When pression <c-l>/<c-j>/<c-k>/<c-h> to move to another nvim split / tmux pane, I get the following error message and the action fails:

E5108: Error executing lua .../pack/packer/start/Navigator.nvim/lua/Navigator/tmux.lua:28: bad argument #1 to 'read' (invalid option)

which points to an issue in this line:

https://github.com/numToStr/Navigator.nvim/blob/ff87ccf64be8edb0cc783131ceba1d44a87a5f81/lua/Navigator/tmux.lua#L28

I get no such issue with the regular vim-tmux-navigator plugin.

numToStr commented 3 years ago

Thanks for the detailed report. I am seeing your LuaJIT version is 2.0.5 which is different than mine which is

NVIM v0.5.0-dev+1221-g9b2d4ff62
Build type: Release
LuaJIT 2.1.0-beta3

Can you try to update neovim and see if that fixes the issue?

ruifm commented 3 years ago

Thanks @numToStr , using luajit 2.1.0-beta3 and rebuilding neovim solves the issue.

I'm using luajit 2.05 because it's the one in arch repos and thus is the one pulled when installing neovim-git from the AUR.

I would suggest either:

The first one would be preferable of course :wink:

numToStr commented 3 years ago

I am glad that updating fixes your issue. I'll add a note on about LuaJIT 2.1.0 or use HEAD.

ruifm commented 3 years ago

or use HEAD.

It has nothing to do with HEAD, I'm always using HEAD. It's entirely related to the version of luajit neovim was compiled with.

numToStr commented 3 years ago

Ohh i see. I was not aware of that as I always build from the repo.

ruifm commented 3 years ago

Ohh i see. I was not aware of that as I always build from the repo.

Yeah, if you build manually from the repo you end up using their bundled dependencies which includes that luajit version, but other package managers which offer HEAD (arch's AUR/ nixOS/ brew) automatically build HEAD from the repo but often use the system versions of neovim's dependencies to avoid duplication.

Ref: https://github.com/neovim/neovim/wiki/Building-Neovim#third-party-dependencies