Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
631 stars 26 forks source link

Windows overlapping -> Cannot see signature help #45

Open stefanwatt opened 2 days ago

stefanwatt commented 2 days ago

image I could probably make a PR for this if you want me to. IMO then window layout should be calculated something like this:

  1. calculate max(autocomplete.height, documentation.height) -> they should start on the same row
  2. add height of signature help -> combined height
  3. calculate top of total layout based on cursor relative to viewport, in signature help windows bottom row should be one row above cursor row, the other two windows top row should be one row below cursor.

But....what happens if there's not enough room in the viewport to fit the autocompletion window below the cursor? It would have to be placed above. If that's the case then the signature help window would be placed awkwardly far above (or not displayed?).

Saghen commented 2 days ago

calculate max(autocomplete.height, documentation.height) -> they should start on the same row

Totally agree

But....what happens if there's not enough room in the viewport to fit the autocompletion window below the cursor? It would have to be placed above. If that's the case then the signature help window would be placed awkwardly far above (or not displayed?).

I was thinking it would make sense to put the signature help in place of the documentation, and have the documentation only show up on manual trigger. Wdyt?

stefanwatt commented 2 days ago

I guess it's up to preference 🤷 I agree that displaying both signature help and autocompletion window is probably not gonna work. So maybe add a field on blink.cmp.WindowConfig like displayWhenOverlapping. Possible values signature-help and autocompletion. Default value signature-help Always just showing signature help would be the easiest. If it's configurable like that, then there has to be some code to calculate autocompletion window position differently when it's a "drop-up". Your call.