Skip to content

Is it possible to redirect a promp output to current cursor location? #545

Answered by dhruvinsh
dhruvinsh asked this question in Q&A
Discussion options

You must be logged in to vote

after much pondering, I come up with this solution,

-- codecompanion: gitcommit accept
vim.api.nvim_create_autocmd({ "User" }, {
  pattern = "CodeCompanionDiffAttached",
  group = utils.augroup("gitcommit_accept", true),
  callback = function(request)
    local bufnr = request.data.bufnr
    if vim.bo[bufnr].filetype == "gitcommit" then
      vim.defer_fn(function()
        vim.api.nvim_feedkeys("ga", "t", false)
      end, 1000)
    end
  end,
})

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dhruvinsh
Comment options

@dhruvinsh
Comment options

Answer selected by dhruvinsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant