Skip to content

Commit

Permalink
fix: renaming did not work any longer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed Apr 9, 2024
1 parent ebee4ac commit 35acea6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lua/yazi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,21 @@ function M.yazi(path)

-- process events emitted from yazi
local events = utils.read_events_file(M.config.events_file_path)
local rename_events = iterators
.iter(events)
:filter(function(event)
return event.type == 'rename'
end)
:map(
---@param event YaziRenameEvent
function(event)
return event.data
end
)
:tolist()

local renames =
utils.get_buffers_that_need_renaming_after_yazi_exited(iterators
.iter(events)
:filter(function(event)
return event.type == 'rename'
end)
:tolist())
utils.get_buffers_that_need_renaming_after_yazi_exited(rename_events)

for _, event in ipairs(renames) do
vim.api.nvim_buf_set_name(event.bufnr, event.path.filename)
Expand Down

0 comments on commit 35acea6

Please sign in to comment.