Description
I have foldmethod=indent and foldlevelstart=0 in my config, and this causes the telescope results buffer to break. My workaround right now is an autocommand that sets foldmethod=manual for the TelescopeResults filetype.
Update: I missed something. It was in fact the combination of shiftwidth=0 (uses tabstop instead) and foldmethod=indent that was causing the issue.
Neovim version
NVIM v0.11.6
Build type: RelWithDebInfo
LuaJIT 2.1.1772619647
Operating system and version
Arch Linux (Last system update around 13/03/2026)
Telescope version / branch / rev
master
checkhealth telescope
telescope: 1 ⚠️
Checking for required plugins ~
- ✅ OK plenary installed.
Checking external dependencies ~
- ✅ OK rg: found ripgrep 15.1.0
- ⚠️ WARNING fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities
===== Installed extensions ===== ~
Telescope Extension: `ui-select` ~
- No healthcheck provided
Steps to reproduce
nvim -nu minimal.lua in a directory with a lot of files
:Telescope find_files (or any telescope with a lot of results)
- Hold to scroll several lines down, then to scroll back up
Expected behavior
No folding should occur in the TelescopeResults buffer.
Actual behavior
Lines seem to be folded at random (despite not actually being indented) as they are scrolled by, eventually hiding all but 3 results.
Minimal config
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs { "config", "data", "state", "cache" } do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system {
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
}
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
-- Problematic fold settings
vim.o.foldmethod = "indent"
vim.o.foldlevelstart = 0
vim.o.foldlevel = 0
vim.o.shiftwidth = 0
require("telescope").setup {}
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
Description
I have
foldmethod=indentandfoldlevelstart=0in my config, and this causes the telescope results buffer to break. My workaround right now is an autocommand that setsfoldmethod=manualfor theTelescopeResultsfiletype.Update: I missed something. It was in fact the combination of
shiftwidth=0(usestabstopinstead) andfoldmethod=indentthat was causing the issue.Neovim version
Operating system and version
Arch Linux (Last system update around 13/03/2026)
Telescope version / branch / rev
master
checkhealth telescope
Steps to reproduce
nvim -nu minimal.luain a directory with a lot of files:Telescope find_files(or any telescope with a lot of results)Expected behavior
No folding should occur in the TelescopeResults buffer.
Actual behavior
Lines seem to be folded at random (despite not actually being indented) as they are scrolled by, eventually hiding all but 3 results.
Minimal config