Skip to content

Commit

Permalink
fix: not entering insert mode when invoked from telescope results
Browse files Browse the repository at this point in the history
I have a custom `my_find_file_in_project` function that I use to
navigate to the files in my current project.

This invokes telescope to display the files, and if a directory is
selected, it opens yazi to browse the directory.

The problem was that when yazi was opened for a directory, yazi would
open in normal mode, and would not accept any commands and just move the
neovim cursor instead.

This change fixes that issue for me.

You can see the current implementation here:

https://github.com/mikavilpas/dotfiles/blob/00c5719241d9ed09a48417645d92e2e3706ab534/.config/nvim/lua/plugins/telescope.lua?plain=1#L47
  • Loading branch information
mikavilpas committed Mar 14, 2024
1 parent b76bf52 commit 4beaec3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/yazi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ function M.yazi(path)
end,
})
end
vim.cmd('startinsert')
vim.schedule(function()
vim.cmd('startinsert')
end)
end

M.config = config.default()
Expand Down

0 comments on commit 4beaec3

Please sign in to comment.