Just main editor to currently selected Glance position
Opened this issue · 6 comments
In VSCode if I have references glance view sometimes I like to move the main editor to the position of currently selected popup item without closing the popup. It updates the breadcrumbs at the top of the windows and helps me understand where I currently am in the file and I continue from there.
Do you think it's possible to trigger such jump of the main window without closing the popup with glance.nvim?
Another solution I can think of would be to restore the last glance popup to continue my search. Would that be possible?
Sorry, i didn't get the part "make the main editor to the position of currently selected popup item", how does that work? You want to activate selected location in the active window (main editor) without closing the preview?
Another solution I can think of would be to restore the last glance popup to continue my search. Would that be possible?
Hmm, good idea, i will think about implementing show/hide commands.
Thank you for the answer!
Yes, you understood correctly. I am interested in activated selected location in the active window to update the winbar with the (nvim-navic)[https://github.com/SmiteshP/nvim-navic] breadcrumbs what would help me orient in the code.
Side question: do you think it’s possible to activate the winbar in the glance’s preview window? That would resolve the issue. Currently glance’s preview works just like another buffer (with signcolumn, etc., love it) but winbar is hidden.
I see. Not sure about breadcrumbs, but having an option to jump to location while maintaining the preview window open sounds useful.
Glance already uses the winbar to display location's filename and path, technically you could disable it in your config and use your own winbar, but I'm not sure how that will work in a floating window, you'd probably need to do extra configuration for that in a winbar manager you're using. Usually they ignore floating windows.
Great, thank you for the hint! I'll check soon how much I can customize the winbar for floating window and come back to you.
Just a suggestion - my two cents. The symbolsoutline plug-in does this exactly. It uses 'o' for the preview/navigate, but keeps the focus on the selected item in its plug-in buffer. If you press enter on a selected item, it opens that location and moves the focus to that buffer. I think it works quite well. Would be nice to have consistent key binds :)
Nice suggestion @elliotwesoff! But symboloutline is using a split view, I am not sure if the same, change the cursor location without closing current window, is possible with floating windows.
@DNLHC do you think it's possible to change the location of the main window while floating window is still visible?
Besides, I managed to get what I want by extending the winbar_value
here: https://github.com/DNLHC/glance.nvim/blob/master/lua/glance/winbar.lua#L36 by concatenating it with mine %{%v:lua.require'nvim-navic'.get_location()%}
from nvim-navic.
@DNLHC, do you think winbar_value
could be somehow configurable so that I can use your repository instead of my fork?