Skip to content

Commit

Permalink
feat(char): hide flash when doing an ftFT search while yanking. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 28, 2023
1 parent 28bf4a4 commit feda1d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/flash/plugins/char.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ function M.setup()
end
end

vim.api.nvim_create_autocmd({ "BufLeave", "CursorMoved", "InsertEnter" }, {
vim.api.nvim_create_autocmd({ "BufLeave", "CursorMoved", "InsertEnter", "TextYankPost" }, {
group = vim.api.nvim_create_augroup("flash_char", { clear = true }),
callback = function(event)
if (event.event == "InsertEnter" or not M.jumping) and M.state then
local hide = event.event == "InsertEnter"
or (event.event == "TextYankPost" and vim.v.operator == "y")
or not M.jumping
if hide and M.state then
M.state:hide()
end
end,
Expand Down

0 comments on commit feda1d5

Please sign in to comment.