Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you disable folds inside pickers? #991

Closed
mystilleef opened this issue Jul 14, 2021 · 5 comments · Fixed by #1019
Closed

How do you disable folds inside pickers? #991

mystilleef opened this issue Jul 14, 2021 · 5 comments · Fixed by #1019

Comments

@mystilleef
Copy link

I have the following fold settings.

set foldclose=all
set foldopen=all

When I open pickers, navigating the result list in normal mode with j/k results in folds. Is this expected behavior, and is there a way to turn it off?

I've attached a video showing the issue.

telescope_fold_problem.mp4
@Conni2461
Copy link
Member

We had a similar conversation over #978 we are probably introducing a TelescopeResults filetype so you can disable folds for that filetype (or we just disable folds for that filetype)

Conni2461 pushed a commit that referenced this issue Jul 18, 2021
**Why** is the change needed?

So that it can be targeted with specific settings. These could include disabling
plugins for the buffer (as in #840) or disabling folding (as per #991).

**How** is the need addressed?

- Add a filetype to the buffer after it has been created.

Closes #991
@Conni2461
Copy link
Member

TelescopeResults is now a filetype so you can disable folds for it

@mystilleef
Copy link
Author

For the benefit of new users, add the following to your .vimrc, or init.vim right after you initialized Telescope.

" disable folding in telescope's result window
autocmd! FileType TelescopeResults setlocal nofoldenable

It might help to also add this to the docs or faq for new users.

@Conni2461
Copy link
Member

I am currently reworking documentation, so i'll add it :)

@arbitrary-dev
Copy link

Now also in Lua:

-- Disable folding in Telescope's result window.
vim.api.nvim_create_autocmd("FileType", { pattern = "TelescopeResults", command = [[setlocal nofoldenable]] })

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 a pull request may close this issue.

3 participants