mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-05 10:46:08 +00:00
feat: Add fetch/push commands and log keybinds, make long-running operations non-blocking
Convert blocking jj commands to async using vim.fn.jobstart() to prevent UI freezing during fetch, push, rebase, squash, and other heavy operations. Changes: - Implement execute_command_async() in runner with proper error handling - Captures stdout from job and passes to success callback - Supports stdin input for commands that require it - Includes silent flag to suppress error notifications - Replicates sync version's error handling behavior - Convert blocking operations to async: - handle_log_fetch, handle_log_push_all, handle_log_new - handle_log_edit, handle_log_abandon, handle_log_describe - describe.execute_describe, all init.lua commands - Add push/fetch as public commands with CLI support: - M.fetch() - fetch from remote - M.push(opts) - push all changes or specific bookmark - CLI: :J push, :J push <bookmark>, :J fetch - Implement handle_log_push_bookmark() for revision under cursor: - Retrieves and strips modified bookmark indicator (*) - Pushes specific bookmark to remote - Keybind: Shift+p in log buffer - Update README with new keybinds: - a: abandon revision under cursor - f: fetch from remote - p: push all changes - Shift+p: push revision's bookmark - Add Lua API docs for push command options
This commit is contained in:
@@ -30,10 +30,9 @@ local function execute_describe(description, revset)
|
||||
cmd = cmd .. " --stdin"
|
||||
|
||||
-- Use --stdin to properly handle multi-line and special characters
|
||||
local _, success = runner.execute_command(cmd, "Failed to describe", description)
|
||||
if success then
|
||||
runner.execute_command_async(cmd, function()
|
||||
utils.notify("Description set.", vim.log.levels.INFO)
|
||||
end
|
||||
end, "Failed to describe", description)
|
||||
end
|
||||
|
||||
--- Resolve describe editor keymaps from config
|
||||
@@ -151,3 +150,4 @@ function M.describe(description, revset, opts)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
|
||||
Reference in New Issue
Block a user