From e4642267422c2046e8337902e333e2406ca5728f Mon Sep 17 00:00:00 2001 From: Huy Le Date: Tue, 12 Nov 2024 15:18:44 -0700 Subject: [PATCH] adding openrouter --- lua/ogpt/flows/actions/popup/init.lua | 45 --------------------------- 1 file changed, 45 deletions(-) diff --git a/lua/ogpt/flows/actions/popup/init.lua b/lua/ogpt/flows/actions/popup/init.lua index 1e51ce4..3b3efc2 100644 --- a/lua/ogpt/flows/actions/popup/init.lua +++ b/lua/ogpt/flows/actions/popup/init.lua @@ -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] == "" 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