Repository: neovim
Issue: Crash: telescope, treesitter, fold settings, showbreak
Labels: has:repro,has:backtrace,bug-crash

### Problem

Neovim randomly crashes if any Telescope command is run as `+` command from the shell. 

```c++
#0  finderrfunc (L=0x7fcc75317380) at lj_err.c:807
#1  lj_err_run (L=L@entry=0x7fcc75317380) at lj_err.c:843
#2  0x00005634e679727d in err_msgv (L=L@entry=0x7fcc75317380, em=em@entry=LJ_ERR_BADOPRV) at lj_err.c:882
#3  0x00005634e6797405 in lj_err_optype (L=0x7fcc75317380, o=<optimized out>, opm=opm@entry=LJ_ERR_OPCALL)
    at lj_err.c:918
#4  0x00005634e67974e2 in lj_err_optype_call (L=L@entry=0x7fcc75317380, o=o@entry=0x7fcc75295ca0) at lj_err.c:946
#5  0x00005634e67bd12f in lj_meta_call (L=0x7fcc75317380, func=0x7fcc75295ca0, top=0x7fcc75295cb8) at lj_meta.c:447
#6  0x00005634e67b687e in lj_vmeta_call ()
#7  0x00005634e67a23e5 in lua_pcall (L=0x7fcc75317380, nargs=<optimized out>, nresults=0, errfunc=<optimized out>)
    at lj_api.c:1116
#8  0x00005634e655b50f in nlua_pcall (lstate=0x7fcc75317380, nargs=1, nresults=0)
    at .../neovim/src/nvim/lua/executor.c:164
#9  0x00005634e656129e in nlua_do_ucmd (cmd=0x5634e7cf8490, eap=0x7ffe98998140, preview=false)
    at .../neovim/src/nvim/lua/executor.c:2239
#10 0x00005634e66e4e1d in do_ucmd (eap=0x7ffe98998140, preview=false)
    at .../neovim/src/nvim/usercmd.c:1642
#11 0x00005634e64eee39 in execute_cmd0 (retv=0x7ffe989980f8, eap=0x7ffe98998140, errormsg=0x7ffe98998110, 
    preview=false) at .../neovim/src/nvim/ex_docmd.c:1626
#12 0x00005634e64f0d64 in do_one_cmd (cmdlinep=0x7ffe98998360, flags=11, cstack=0x7ffe98998470, fgetline=0x0, 
    cookie=0x0) at .../neovim/src/nvim/ex_docmd.c:2293
#13 0x00005634e64ec8f5 in do_cmdline (cmdline=0x7ffe9899ab32 "Telescope builtin", fgetline=0x0, cookie=0x0, flags=11)
    at .../neovim/src/nvim/ex_docmd.c:592
#14 0x00005634e64ebec8 in do_cmdline_cmd (cmd=0x7ffe9899ab32 "Telescope builtin")
    at .../neovim/src/nvim/ex_docmd.c:291
#15 0x00005634e63ba6e8 in exe_commands (parmp=0x7ffe98998aa0) at .../neovim/src/nvim/main.c:1901
#16 0x00005634e63b67c5 in main (argc=6, argv=0x7ffe98998d18) at .../neovim/src/nvim/main.c:579
```

Plugin versions:
- plenary: 36aaceb6e93addd20b1b18f94d86aecc552f30c4
- telescope: ffe35cb433192fcb5080b557c1aef14d37092035

Please change the title to something more accurate if you can minimize my example. 

### Steps to reproduce

1. Create `telescope_crash.lua` with
```lua
local configDir = vim.fn.expand('<sfile>:p:h')

vim.env['XDG_CONFIG_HOME'] = configDir
vim.env['XDG_DATA_HOME'] = configDir .. '/.xdg/data'
vim.env['XDG_STATE_HOME'] = configDir .. '/.xdg/state'
vim.env['XDG_CACHE_HOME'] = configDir .. '/.xdg/cache'
local stdPathConfig = vim.fn.stdpath('config')

vim.opt.runtimepath:prepend(stdPathConfig)
vim.opt.packpath:prepend(stdPathConfig)
local plugins_path = vim.fn.fnamemodify('plugins/', ':p')

for name, url in pairs{
  ['plenary.nvim'] = 'https://github.com/nvim-lua/plenary.nvim',
  ['telescope.nvim'] = 'https://github.com/nvim-telescope/telescope.nvim',
} do
  local install_path = plugins_path .. name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.opt.runtimepath:append(install_path)
end

require('telescope').setup { }

vim.wo.showbreak = '> '
vim.go.foldlevelstart = 99
vim.wo.foldcolumn = 'auto'
vim.wo.foldmethod='expr'
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
```
2.  Make waiting for crash easier:
```bash
i=0; 
trap '{ echo -e "\nInterrupted after successful $i attempts." ; exit 0; }' INT
while true; do 
  ((i++));
  nvim --clean -u telescope_crash.lua +Telescope\ builtin +qa! || { echo ${i}-th: $?; break; };
  sleep .2; 
done
```

For me, the loop above broke after between 1 and 14 starts. 

### Expected behavior

No crash.

### Neovim version (nvim -v)

NVIM v0.10.0-dev-567+g4dc86477b

### Vim (not Nvim) behaves the same?

-

### Operating system/version

Debian Sid

### Terminal name/version

tmux 3.3a-4, kitty 0.26.5

### $TERM environment variable

tmux-256color

### Installation

build from repo


Edited to minimize the config. The backtrace above comes from the first example with nvim-treesitter plugin.