fix(picker.input): startinsert when starting the picker from terminal mode. See #2390

This commit is contained in:
Folke Lemaitre 2025-11-05 08:10:13 +01:00
parent 41da728f02
commit b2054a3a73
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -51,7 +51,13 @@ function M.new(picker)
self.win:on("BufEnter", function()
vim.bo[self.win.buf].buftype = "prompt"
vim.cmd("startinsert!")
if vim.fn.mode() == "t" then
vim.schedule(function()
vim.cmd("startinsert!")
end)
else
vim.cmd("startinsert!")
end
end, { buf = true })
local ref = Snacks.util.ref(self)