nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.42k stars 286 forks source link

Jump to cursor position in `peek_definition` preview window #1329

Closed kair8m closed 11 months ago

kair8m commented 11 months ago

Is your feature request related to a problem? Please describe. Currently, if you try to open peek_definition preview window you will jump directly to definition of the symbol you requested. However, in most case scenarios you actually move your cursor around the definition and you don't expect to expand the preview window in another place

Describe the solution you'd like It would be much better to save cursor position within preview buffer and when jumping to a location of definition you actually restore the last position you saved in preview buffer

Describe alternatives you've considered N/A

Additional context Please take a look here 1) I call Lspsaga peek_definition 2) I move around 3) I press open and I am completely confused where am I

render1697642465080

glepnir commented 11 months ago

definition.save_pos = true