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

Does not work in Vim8 #7

Open
funguscolander opened this issue Feb 28, 2021 · 1 comment
Open

Does not work in Vim8 #7

funguscolander opened this issue Feb 28, 2021 · 1 comment

Comments

@funguscolander
Copy link

funguscolander commented Feb 28, 2021

The plugin calls references to the functions nvim_create_buf and nvim_create_win which do not seem to exist in Vim, causing the plugin to error out upon the first call of leaderGuide#start_by_prefix. I am assuming these are defined in NVim and that this is why it is incompatible. Is there an alternative that will accomplish the same goal in Vim, and are there other incompatibilities elsewhere?

@spinks
Copy link
Owner

spinks commented Feb 28, 2021

Yes, when I swapped it over to NVim floating windows the Vim alternative was not as well defined and as such I just took on the NVim specific functions (in effect dropping regular vim support).

There is now better support for a floating style window through the Popup API, and so it would be possible to create window creation functions around that method instead of the NVim methods. Working with the popup windows and creating/writing buffers in vim is a bit less elegant iirc so would take some work to adapt.

I believe that the only incompatibilities would lie in these window and buffer creation functions.

As a reference, vim-which-key implements Vim popup windows as such: vim-which-key/window.vim (also illustrating the Vim method to create and write the buffer).

Alternatively, until the vim popup methods are implemented, you could drop back to the legacy branch, which has the old style windows but is vim compatible.

funguscolander added a commit to funguscolander/vim-leader-guide that referenced this issue Mar 11, 2021
-basic framework for popup window to address spinks#7
this introduces a bug with the following error message:
```
Error detected while processing function leaderGuide#start_by_prefix[20]..<SNR>37_start_buffer[2]..<SNR>37_create_string:
line    9:
E117: Unknown function:1
E702: Sort compare function failed
Error detected while processing function leaderGuide#start_by_prefix[20]..<SNR>37_start_buffer:
Line 8:
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants