Skip to content

Bug: picker does not start in insert mode with ModeChanged autocmd and prompt buffer #2545

@igorlfs

Description

@igorlfs

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

Linux

Shell

fish

Neovim version (nvim --version)

NVIM v0.12.0-dev-2155+g1e6c4ea896

Fzf version (fzf --version)

0.67.0 (2ab923f3)

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 --color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc --color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 --color=selected-bg:#45475a --multi

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

require('fzf-lua').setup({
})

Describe the bug / steps to reproduce

Hello,

Kinda convoluted setup:

  • Minimal config:
vim.pack.add({ "https://github.com/ibhagwan/fzf-lua" })

local api = vim.api

api.nvim_create_autocmd("ModeChanged", {
	callback = function()
		for _, tab in ipairs(api.nvim_list_tabpages()) do
			for _, win in ipairs(api.nvim_tabpage_list_wins(tab)) do
				local buf = api.nvim_win_get_buf(win)

				local _bt = vim.bo[buf].buftype
			end
		end
	end,
})
  • Repro:
  1. nvim -u minimal.lua
  2. :set bt=prompt
  3. :tabnew
  4. :FzfLua buffers

Not sure why this happens, could be a bug upstream. I've looked into wrapping

vim.cmd [[startinsert]]

Into a utils.eventignore, to no avail. Works if I wrap the autocmd callback into a vim.schedule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamAn issue upstream (neovim, fzf, etc)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions