mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-07 14:48:36 +00:00
The cursor layout uses winline() and wincol() to calculate the cursor position. Both these functions operate on the currently active window. The first time the calculations are performed, that happens to be the window active before showing the Telescope window. However, if the editor is then resized or the preview window is toggled, the active window changes. The result is that recalculating the position is then done using the wrong window, resulting in the Telescope window moving around in an erratic manner. To fix this, we have to scope the winline() and wincol() calls to the original window ID.