kevinhwang91 / rnvimr

Make Ranger running in a floating window to communicate with Neovim via RPC
BSD 3-Clause "New" or "Revised" License
800 stars 17 forks source link

rnvimr doesn't focus the opened file/buffer? #128

Closed gacallea closed 1 year ago

gacallea commented 1 year ago
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.8.1/share/nvim"

Run :checkhealth for more info

Describe the bug not sure this is a bug or my misconfiguration, but when I open a file (enter or l), the opened buffer is not focused. the focus remains on the already previously opened file/buffer.

To Reproduce using nvim -u mini.vim

my lunarvim config, just in case: https://github.com/gacallea/lunarvim

specific to rnvimr: https://github.com/gacallea/lunarvim/blob/main/lua/plugins.lua#L8-L18

Steps to reproduce the behavior:

  1. launch rnvimr
  2. open file
  3. focus is on old file

Expected behavior to have the newly opened file/buffer focused instead

GIF rnvimr

kevinhwang91 commented 1 year ago

Can't reproduce the issue, maybe your config issue.

gacallea commented 1 year ago

@kevinhwang91 thank you for the quick test/reply, I appreciate :)

any suggestions where to look? any particular config/option? i suspect this may be upstream (lunarvim).

cheers :)

kevinhwang91 commented 1 year ago

Not a lunarvim user. You should binary search the culprit plugin.

gacallea commented 1 year ago

oh, I meant rnvimr config that could be clashing. like that is set, but overridden/bypassed somehow? :)

kevinhwang91 commented 1 year ago

No valid info about that, you should use mini config to make sure rnvimr work as expected and add your rnvimr config. If everything is fine, put them into lunarvim and find culprit plugin.

gacallea commented 1 year ago

I've found it :) it's minimap! :)

I did add rnvimr to the block/close options but it aint working. what is the correct "name" to use? apparently rnvimr ain't working here.

vim.cmd("let g:minimap_block_buftypes =  [ 'nofile', 'nowrite', 'quickfix', 'terminal', 'prompt' ]")
vim.cmd("let g:minimap_close_buftypes =  [ 'nofile', 'nowrite', 'quickfix', 'terminal', 'prompt' ]")
vim.cmd("let g:minimap_block_filetypes = [ 'packer', 'bufferline', 'telescope', 'alpha', 'netrw', 'rnvimr', 'trouble', 'diffview', 'goto-preview', 'lazygit' ]")
vim.cmd("let g:minimap_close_filetypes = [ 'packer', 'bufferline', 'telescope', 'alpha', 'netrw', 'rnvimr', 'trouble', 'diffview', 'goto-preview', 'lazygit' ]")

cheers

gacallea commented 1 year ago

I found this old issue that is related. there is some incompatibility that has to do with rnvimr consider minimap as new window, allegedly. https://github.com/wfxr/minimap.vim/issues/71

gacallea commented 1 year ago

I've temporarily removed minimap, too many conflicts with too many plugins. thank you for your help :)

kevinhwang91 commented 1 year ago

I will check it out later, maybe can be compatible with minimap.vim.

kevinhwang91 commented 1 year ago

After debuging, minimap.vim always changes the previous (last accessed) window without restoring(winc p doesn't work). Not a rnvimr issue.