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

vim-markbar may be incompatible with vim-signature? #8

Closed
andrewferrier opened this issue Nov 15, 2018 · 6 comments
Closed

vim-markbar may be incompatible with vim-signature? #8

andrewferrier opened this issue Nov 15, 2018 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@andrewferrier
Copy link

I've been seeing random bugs related to Netrw and markbar for a few weeks. I think I've isolated the problem a bit...

To recreate:

nvim v0.3.1 on OS X (exact version/OS probably doesn't matter).

With a ~/.config/nvim/init.vim of:

call plug#begin()
Plug 'tpope/vim-vinegar'
Plug 'kshenoy/vim-signature'
Plug 'Yilin-Yang/vim-markbar'
call plug#end()

(and vim-plug installed, i.e. https://github.com/junegunn/vim-plug/blob/master/plug.vim in ~/.config/nvim/autoload - although I suspect the plugin manager doesn't matter).

I open nvim just by typing nvim. I hit - twice to navigate up to the parent directory, then again for its parent (this is a feature vim-vinegar provides but I don't think it's directly related to the bug as I've seen it in other places, just not easily recreatable).

I now see an error that looks like this:

Error detected while processing function <SNR>9_opendir[7]..<SNR>48_NetrwBrowseUpDir[50]..<SNR>48_NetrwBrowseChgDir[282]..markbar#Pe
ekabooMarkbarController#backtick[3]..markbar#MarkbarController#openMarkbar[11]..markbar#MarkbarController#_populateWithMarkbar[3]..m
arkbar#PeekabooMarkbarController#_getMarkbarContents[2]..markbar#MarkbarController#_generateMarkbarContents:
line    6:
E716: Key not present in Dictionary: 1
E15: Invalid expression: l:buffer_caches[a:buffer_no]['_marks_dict']
Error detected while processing function <SNR>9_opendir[7]..<SNR>48_NetrwBrowseUpDir[50]..<SNR>48_NetrwBrowseChgDir[282]..markbar#Pe
ekabooMarkbarController#backtick[3]..markbar#MarkbarController#openMarkbar[11]..markbar#MarkbarController#_populateWithMarkbar:
line    3:
E734: Wrong variable type for +=

Judging by the error, it looks like some interaction error between vim-signature and vim-markbar, but I'm not sure which is at fault. Sorry I haven't dug any further.

Thanks again for all your work on vim-markbar - great plugin!

@andrewferrier
Copy link
Author

I should add that the plugin commits are as follows:

  • vim-signature: 6bc3dd1294a2
  • vim-markbar: 98aeac7
  • vim-vinegar: c38ea2195a43747

I think they are all the latest at time of writing.

@Yilin-Yang Yilin-Yang self-assigned this Nov 18, 2018
@Yilin-Yang Yilin-Yang added the bug Something isn't working label Nov 18, 2018
@Yilin-Yang
Copy link
Owner

Thanks for the report! I've been able to replicate this on my machine, and I'll start working on a fix!

@Yilin-Yang
Copy link
Owner

I think I've tracked down the issue!

Based on the callstack in the error message you posted, line 282 in Netrw's s:NetrwBrowseChgDir function is trying to open the 'backtick' peekaboo markbar, which causes an error.

That turns out to be line 4780 in [n]vim/runtime/autoload/netrw.vim, which happens to be:

   endif
   NetrwKeepj call s:SetRexDir(a:islocal,dirname)
   norm m` " <-- this one

  elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")

I'm still not sure why this line only throws an error if vim-signature is enabled, but changing that line to norm! m` (as is done elsewhere in that same file) fixes the issue on my machine.

The elegant/permanent fix for this problem is probably involves opening a pull request in the vim/neovim repos, but since that might take a while, I'll see if I can figure out how to "hide" markbar from Netrw in the meantime!

Yilin-Yang added a commit that referenced this issue Nov 19, 2018
Add logic to silently refuse to open the peekaboo markbar if the current
buffer trips a test held inside `g:markbar_peekaboo_invocation_filters`.

For now, this prevents the peekaboo markbar from opening inside of netrw
buffers. Addresses Issue #8.
@Yilin-Yang
Copy link
Owner

Just pushed a fix to issue_8! When you have the time, could you pull from that branch and see if it fixes the issue?

Thanks so much for your help!

@andrewferrier
Copy link
Author

Just tested this. Works perfectly! Thanks again for the very prompt response.

@Yilin-Yang
Copy link
Owner

It's my pleasure! 😄

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

No branches or pull requests

2 participants