feat: refresh buffers when moving the change (#92)

This commit is contained in:
Wonung Kim
2026-02-23 10:11:20 +01:00
committed by GitHub
parent 5156fa1a3e
commit f3511cb4b3
4 changed files with 10 additions and 0 deletions
+1
View File
@@ -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
+3
View File
@@ -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))
+1
View File
@@ -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,
+5
View File
@@ -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