Skip to content

Commit

Permalink
adding openrouter
Browse files Browse the repository at this point in the history
  • Loading branch information
huynle committed Nov 12, 2024
1 parent e85e241 commit e464226
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions lua/ogpt/flows/actions/popup/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,49 +167,4 @@ function PopupAction:on_result(response)
end
end

-- function PopupAction:on_result(response)
-- local content = response:pop_content()
-- local answer = content[1]
-- local state = content[2]
--
-- self:set_loading(false)
-- local lines = utils.split_string_by_line(answer)
-- local _, start_row, start_col, end_row, end_col = self:get_visual_selection()
-- local bufnr = self:get_bufnr()
-- if self.strategy == STRATEGY_PREPEND then
-- answer = answer .. "\n" .. self:get_selected_text()
-- vim.api.nvim_buf_set_text(bufnr, start_row - 1, start_col - 1, end_row - 1, end_col, lines)
-- elseif self.strategy == STRATEGY_APPEND then
-- answer = self:get_selected_text() .. "\n\n" .. answer .. "\n"
-- vim.api.nvim_buf_set_text(bufnr, start_row - 1, start_col - 1, end_row - 1, end_col, lines)
-- elseif self.strategy == STRATEGY_REPLACE then
-- answer = answer
-- vim.api.nvim_buf_set_text(bufnr, start_row - 1, start_col - 1, end_row - 1, end_col, lines)
-- elseif self.strategy == STRATEGY_QUICK_FIX then
-- if #lines == 1 and lines[1] == "<OK>" then
-- vim.notify("Your Code looks fine, no issues.", vim.log.levels.INFO)
-- return
-- end
--
-- local entries = {}
-- for _, line in ipairs(lines) do
-- local lnum, text = line:match("(%d+):(.*)")
-- if lnum then
-- local entry = { filename = vim.fn.expand("%:p"), lnum = tonumber(lnum), text = text }
-- table.insert(entries, entry)
-- end
-- end
-- if entries then
-- vim.fn.setqflist(entries)
-- vim.cmd(Config.options.show_quickfixes_cmd)
-- end
-- end
--
-- -- set the cursor onto the answer
-- if self.strategy == STRATEGY_APPEND then
-- local target_line = end_row + 3
-- vim.api.nvim_win_set_cursor(0, { target_line, 0 })
-- end
-- end

return PopupAction

0 comments on commit e464226

Please sign in to comment.