-
Notifications
You must be signed in to change notification settings - Fork 306
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
Improved neovim floating windows, and misc. other improvements #921
Conversation
@prabirshrestha Please check the failing macOS workflow. The error seems to be unrelated to this PR. |
@subnut The failing workflow is just because the latest Neovim nightly build has no artifacts for Mac OS yet, so you can safely ignore it. |
@thomasfaingnaert Thanks! 😄 So.... will you merge this? Or are we going to wait for other collaborators' opinions? |
It's a bit busy at the moment, so I'd rather have @prabirshrestha, @hrsh7th, or @mattn look at this. |
This comment has been minimized.
This comment has been minimized.
Oops, fixed 😄 |
@prabirshrestha, @hrsh7th, @mattn , @thomasfaingnaert |
@subnut thanks for the PR I will have a look at it during the weekend. Popup has been one of the things i have wanted to fix for quite some time so good to see traction here. I have also been working on and off on the popup api in vital.vim which you can find at vim-jp/vital.vim#748. there are still some missing feature but already contains majority of the feature. goal is to ship the You can also find some of my thoughts at vim-jp/vital.vim#747. as for |
@prabirshrestha Yes, I'd seen that PR before. But I think that till that PR gets merged and is eventually integrated in vim-lsp in the future, we should improve the current state of the floating window, right? As it stands right now (before this PR) the popup (especially the documentation popup, i.e. the on that is triggered on CompleteChanged) is unusable in neovim if you use splits. The vim popups are reasonably accurate/perfect. So, why not the same for neovim? I think that the correct course of action would be to merge this PR for now, continue working on that API. When in the (near?) future that API is finalized, throw away all the current wrappers and use the new API. 🥳 I believe that there should be one single wrapper/API that is used by all other plugins, so that development can be concentrated in one place. But I think that till that future API arrives, we should improve what we currently have in our hands. Also, I the |
@prabirshrestha If you are worried about having to test my algorithm, then rest assured. I have tested it extensively myself. In fact I have spent 3 whole days on testing and perfecting before submitting this PR, and even after submitting, still continue to test and correct any errors in my part (see all those forced updates? 😁 ) EDIT: It may happen that I might have left out some feature/variable from the fresh algorithm implemented for neovim in |
we don't have to wait for complete rewrite with vital.vim. This PR should be able to be merged after review. I will spend sometime during the weekend to play with it a bit more. i dont expect the vital.vim Pr to be merged there anytime soon. We can use popup.vim from as part of vim-lsp even before it gets merged but this is a bigger refactor and can be done separately. In the meantime here is a bug I saw. This exists even before this PR. lastest vim on windows. neovim 0.4 on windows. neovim seems to be single line instead of multiple lines. |
Well I tried to implement a workaround for it, but it didn't work. I'll see what I can do over the next week.... EDIT: |
Oops.. OK, will look into this tommorrow.. |
@prabirshrestha Looking closer to your error message, it says that the error occurred at line 39 of let l:height = max([&lines - &cmdheight - l:row, &previewheight]) Now, previously I didn't know that the But Also, Genuinely confused. |
I debuged a bit further and seems like let a:event['row'] = float2nr(a:event['row'])
let a:event['col'] = float2nr(a:event['col']) I'm running neovim nightly so not sure if it is a regression in neovim. Value was something like Are you running neovim 0.4? |
Yep! |
@prabirshrestha Please check if the latest commit fixes that issue. |
would be good if you could also file a bug in neovim. It would be good if |
Hm... Ok. I will open an issue in neovim, but as I don't have first-hand experience regarding this issue, I will mention you there, and you have to provide the details there. Do you agree? Or maybe, in my opinion, since you experienced this issue first-hand, you should file the issue, don't you think? EDIT: |
Neovim nightly (0.5) returns event.row and event.col as floats instead of integers. Floats cause errors in min() and max() functions. So, round them off.
@hrsh7th I removed the Could you please test? |
OK. I will test it. |
I think it almost ready to merge. I think the remaining consideration points are |
@prabirshrestha Is the documentation of |
@hrsh7th |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it ok to merge.
@prabirshrestha Who will merge this? |
I will if all requested changes are resolved. |
@hrsh7th All requested changes have already been resolved, IIRC |
I repeat, Are there any unresolved requested changes? If yes, please show me which one. |
I mean the PR still has request changes status. But I think it OK to merge (I checked all inline comments already resolved) |
Thanks everyone. Great change. |
@mattn I am sure this is un-related, because I did not touch the completion at all Also, if you are on vim, then there should not have been any change at all. This PR only changed neovim behaviour. |
@mattn Did you manage to fix the above issue? If yes, how,? |
Sorry, it was already fixed. a56304f |
Please see the commit messages for details
EDIT:
My main goal in this PR is to improve the (currently deplorable) state of the completion-documentation popup provided by
vim-lsp
. It just so happened that I began by improving thelsp#ui#vim#.....()
functions and ended up with a re-write ofdocumentation.vim
, so I simply included both 😄As a (good) side-effect of making the
lsp#vim#ui
functions relative to the global-grid for neovim, now all popup are accurately positioned, and their positioning does not depend on the current window, splits, tab-line, cmdheight (which is variable in neovim, BTW. If you want, you can make it occupy the whole screen 😬) etc.