Skip to content

Fix file-browser resize errors when no entry is selected#429

Open
RedTrait wants to merge 1 commit into
nvim-telescope:masterfrom
RedTrait:master
Open

Fix file-browser resize errors when no entry is selected#429
RedTrait wants to merge 1 commit into
nvim-telescope:masterfrom
RedTrait:master

Conversation

@RedTrait

@RedTrait RedTrait commented Jul 2, 2026

Copy link
Copy Markdown

Prevent telescope-file-browser from throwing an error during VimResized autocommands when the picker has no active selection.

The resize callback assumed action_state.get_selected_entry() always returned a valid entry and accessed selection.value unconditionally. In practice, the picker can briefly have no selected entry while being refreshed or closed, which causes a Lua error.

This change adds guards for:

  • missing picker state
  • missing selected entry
  • missing selected entry value

When a valid selection exists, the previous selection is restored as before and the picker is refreshed normally.

Prevent telescope-file-browser from throwing an error during VimResized autocommands when the picker has no active selection.

The resize callback assumed action_state.get_selected_entry() always returned a valid entry and accessed selection.value unconditionally. In practice, the picker can briefly have no selected entry while being refreshed or closed, which causes a Lua error.

This change adds guards for:
- missing picker state
- missing selected entry
- missing selected entry value

When a valid selection exists, the previous selection is restored as before and the picker is refreshed normally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant