Skip to content

Conversation

@alexmozaidze
Copy link
Contributor

Description

This is a small modification of #2726 where instead of changing the global options, it simply reloads the folds engine.

The original fix was too invasive to user's configuration, which motivated me to make a better hack. It's still a hack, but not as invasive.

I suspect that the issue is caused by a race condition, where the foldexpr isn't valid at the time of opening the file, but is valid after the file is opened, and thus we reload the engine to re-evaluate the foldexpr. I can't be sure though, a more thorough investigation might be necessary.

Fixes #699

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

This has been tested with my full config. I don't believe that the config is relevant, and the change itself is very small.

Configuration:

  • Neovim version (nvim --version): v0.11.5
  • Operating system and version: Void Linux (latest)

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

This is a small modification of nvim-telescope#2726 where instead of changing the
global options, it simply reloads the folds engine.
@clason clason merged commit 4d0f5e0 into nvim-telescope:master Dec 23, 2025
12 checks passed
@chrs8
Copy link

chrs8 commented Dec 29, 2025

This enables folding whenever a file is opened via telescope. I normally have folding disabled (foldenable = false).

@clason
Copy link
Contributor

clason commented Dec 29, 2025

It doesn't for me. Please open a new issue with a minimal(!) reproducing config. If you have a better solution, PR is welcome.

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.

File opened with Telescope: find_files can't be folded (E490: No fold found)

3 participants