fix(previewer): use new winid after toggle preview window#3614
Merged
clason merged 1 commit intonvim-telescope:masterfrom Jan 23, 2026
Merged
fix(previewer): use new winid after toggle preview window#3614clason merged 1 commit intonvim-telescope:masterfrom
clason merged 1 commit intonvim-telescope:masterfrom
Conversation
e926a1b to
d787718
Compare
d787718 to
6f156e9
Compare
Contributor
Author
|
There is also a hidden bug here: Currently, it only affects the function opts.preview_fn(self, entry, status)
local preview_winid = status.layout.preview and status.layout.preview.winid
+ preview_window_id = preview_winid
if get_bufnr(self) == nil then
set_bufnr(self, api.nvim_win_get_buf(preview_winid))
- preview_window_id = preview_winid
end
if opts.get_buffer_by_name and get_bufnr_by_bufname(self, opts.get_buffer_by_name(self, entry)) then |
Contributor
|
Yes, that was a typo/mistake; I relied on the tests to cover this. (I remember being confused by |
Contributor
Author
Contributor
|
Yeah, the unused part threw me, too... (The codebase is in need of a massive refactor and cleanup.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Can not move selection cursor after toggle preview window.
:Telescope find_filestoggle_previewkey, close and open preview window, keep preview window open.All usages of buffer_preview are affected, for example
git_files.This was introduced after #3561 @clason
Toggle preview will create a new preview window,
preview_winidis the new winid,preview_window_idwas captured and used inopts.teardown(), it should be a bug because this variable is no longer updated.So the change is to set
preview_window_id = preview_winidType of change
Please delete options that are not relevant.
Configuration:
NVIM v0.11.5
Build type: Release
LuaJIT 2.1.1741730670
Run "nvim -V1 -v" for more info
debian 12
Checklist: