diff --git a/README.md b/README.md index 70c79f3..4cc42c8 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,8 @@ _See [config.lua#L9](./lua/avante/config.lua) for the full config_ floating = false, -- Open the 'AvanteAsk' prompt in a floating window start_insert = true, -- Start insert mode when opening the ask window, only effective if floating = true. border = "rounded", + ---@type "ours" | "theirs" + focus_on_apply = "ours", -- which diff to focus after applying }, }, highlights = { diff --git a/lua/avante/config.lua b/lua/avante/config.lua index 69055c4..c193eee 100644 --- a/lua/avante/config.lua +++ b/lua/avante/config.lua @@ -181,6 +181,8 @@ Respect and use existing conventions, libraries, etc that are already present in floating = false, -- Open the 'AvanteAsk' prompt in a floating window border = "rounded", start_insert = true, -- Start insert mode when opening the ask window + ---@alias AvanteInitialDiff "ours" | "theirs" + focus_on_apply = "ours", -- which diff to focus after applying }, }, --- @class AvanteConflictConfig diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 3a4327b..d55d2ff 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -569,7 +569,7 @@ function Sidebar:apply(current_cursor) Diff.process(bufnr) api.nvim_win_set_cursor(winid, { 1, 0 }) vim.defer_fn(function() - Diff.find_next("ours") + Diff.find_next(Config.windows.ask.focus_on_apply) vim.cmd("normal! zz") end, 100) ::continue::