DNLHC/glance.nvim

LSP operations within preview window

Closed this issue · 4 comments

Hey,

How often do you expect users to perform LSP operations within the preview window?

A couple issues I've found is:

  • Calling "Glance definitions" within the preview window doesn't seem to work. IMO, it should close current Glance window and possibly open a new one with the preview of the symbol within the original preview window.

  • Zindex for Glance should be lower then LSP popups such as "hover"

image

In the above image, the preview window is covering the hover info for a symbol's hover info within the preview window.

DNLHC commented

IMO, it should close current Glance window and possibly open a new one with the preview of the symbol within the original preview window

Yes, that was the intended behavior, but clearly something went wrong
Thanks for bringing it to my attention, i'll check it out.

Zindex for Glance should be lower then LSP popups such as "hover"

Good point. I believe zindex should also be configurable by the user.

image

latest commit works great 👍

nyz93 commented

Re-calling Glance inside the preview doesn't work as expected because the preview is closed here:

if is_open() then
before the buffer/position is calculated here:
local parent_bufnr = vim.api.nvim_get_current_buf()

Making sure that nvim_get_current_buf and make_position_params is called before closing the preview does fix the issue but it also causes the plugin to just stop working suddenly.

DNLHC commented

completed in 1ca3ab1