fix(telescope): resolve preview window via status.layout.preview.winid#353
Open
bassemkaroui wants to merge 1 commit intorcarriga:masterfrom
Open
fix(telescope): resolve preview window via status.layout.preview.winid#353bassemkaroui wants to merge 1 commit intorcarriga:masterfrom
bassemkaroui wants to merge 1 commit intorcarriga:masterfrom
Conversation
Telescope removed `status.preview_win` in nvim-telescope/telescope.nvim@e6cdb4d ("require Nvim 0.11 and drop compat shims", #3636). The previewer now exposes the preview window id as `status.layout.preview.winid`. Navigating `:Telescope notify` on current telescope raises `Invalid 'window': Expected Lua number` because `status.preview_win` is nil. Resolve the id via the new field and fall back to the old one to stay compatible with older telescope versions.
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.
Problem
Navigating
:Telescope notifyon a current telescope.nvim build raises:The error fires on every arrow-key navigation (
shift_selection) and onVimResized, making the picker unusable.Cause
telescope.nvim dropped the
status.preview_winfield in nvim-telescope/telescope.nvim@e6cdb4d (feat!: require Nvim 0.11 and drop compat shims, #3636). The preview window id is now exposed asstatus.layout.preview.winid(see telescope's ownbuffer_previewer.lua:419).status.preview_winis thereforenil, whichnvim_win_get_configrejects.Fix
Resolve the preview window id via
status.layout.preview.winid, falling back tostatus.preview_winfor backward compatibility with older telescope versions.Testing
:Telescope notifywith a few queued notifications.<C-n>/<C-p>— preview renders, no moreInvalid 'window'error.VimResizedautocmd no longer throws.status.preview_winexists) — fallback keeps the extension working.