sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.64k stars 182 forks source link

goto commands don't restore selection when location picking is canceled #1977

Closed AmjadHD closed 2 years ago

AmjadHD commented 2 years ago

Describe the bug when there's more than one location available for a goto* command, a quick panel is shown to pick. highlighting entries modifies the selection, canceling the operation doesn't restore the initial selection.

Expected behavior it should restore the selection, like ST's built-in

Screenshots lsp_goto_cancel_bug

Environment (please complete the following information):

Additional context Add any other context about the problem here. For example, whether you're using a helper package or your manual server configuration in LSP.sublime-settings. When using a manual server configuration please include it here if you believe it's applicable.

AmjadHD commented 2 years ago

I guess the problem is here: https://github.com/sublimelsp/LSP/blob/f83cb8654be9fa1bb07efa5bfc89924020a62324/plugin/locationpicker.py#L84-L85