Skip to content

Commit

Permalink
fix: when opening a directory, insert mode is not activated
Browse files Browse the repository at this point in the history
Might fix #58
  • Loading branch information
mikavilpas committed May 5, 2024
1 parent a9d76ab commit 2cf6057
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/yazi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ function M.setup(opts)
-- Remove the buffer as we want to show yazi instead
vim.api.nvim_buf_delete(bufnr, { force = true })
M.yazi(M.config, file)

-- HACK: for some reason, the cursor is not in insert mode when opening
-- yazi, so just simulate pressing "i" to enter insert mode :)
-- It did nothing when when I tried using vim.cmd('startinsert') or vim.cmd('normal! i')
vim.api.nvim_feedkeys('i', 'n', false)
end
end

Expand Down

0 comments on commit 2cf6057

Please sign in to comment.