mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-05 10:46:08 +00:00
feat: refresh buffers when moving the change (#92)
This commit is contained in:
@@ -370,6 +370,7 @@ function M.edit()
|
||||
}, function(input)
|
||||
if input then
|
||||
runner.execute_command_async(string.format("jj edit %s", input), function()
|
||||
utils.reload_changed_file_buffers()
|
||||
M.log({})
|
||||
end, "Error editing change")
|
||||
else
|
||||
|
||||
@@ -408,6 +408,8 @@ function M.handle_log_edit(ignore_immut, close_on_exit)
|
||||
|
||||
-- Try to execute cmd
|
||||
runner.execute_command_async(cmd, function()
|
||||
utils.reload_changed_file_buffers()
|
||||
|
||||
-- Close the terminal buffer
|
||||
if close_on_exit then
|
||||
utils.notify(string.format("Editing change: `%s`", revset), vim.log.levels.INFO)
|
||||
@@ -828,6 +830,7 @@ function M.handle_summary_edit(revset, ignore_immut)
|
||||
end
|
||||
|
||||
runner.execute_command_async(cmd, function()
|
||||
utils.reload_changed_file_buffers()
|
||||
utils.notify(string.format("Editing revset: `%s`", revset), vim.log.levels.INFO)
|
||||
-- Open the file in the current window
|
||||
vim.cmd("edit " .. vim.fn.fnameescape(filepath.new_path))
|
||||
|
||||
@@ -149,6 +149,7 @@ function M.file_log_history(opts, log_lines)
|
||||
)
|
||||
|
||||
if ok then
|
||||
utils.reload_changed_file_buffers()
|
||||
utils.notify(string.format("Editing revision `%s`", item.rev), vim.log.levels.INFO)
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -690,4 +690,9 @@ function M.extract_description_from_describe(lines)
|
||||
return trimmed_description
|
||||
end
|
||||
|
||||
--- Reload loaded file buffers after working-copy changes.
|
||||
function M.reload_changed_file_buffers()
|
||||
vim.cmd.checktime()
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user