chore: run stylua [generated] (#460)
* chore: add stylua Signed-off-by: Aaron Pham <contact@aarnphm.xyz> * chore: running stylua Signed-off-by: Aaron Pham <contact@aarnphm.xyz> --------- Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
local Config = require("avante.config")
|
||||
local Utils = require("avante.utils")
|
||||
local Config = require "avante.config"
|
||||
local Utils = require "avante.utils"
|
||||
|
||||
---@class avante.ApiToggle
|
||||
---@operator call(): boolean
|
||||
@@ -17,18 +17,12 @@ local Utils = require("avante.utils")
|
||||
local M = {}
|
||||
|
||||
---@param target Provider
|
||||
M.switch_provider = function(target)
|
||||
require("avante.providers").refresh(target)
|
||||
end
|
||||
M.switch_provider = function(target) require("avante.providers").refresh(target) end
|
||||
|
||||
---@param question? string
|
||||
M.ask = function(question)
|
||||
if not require("avante").toggle() then
|
||||
return false
|
||||
end
|
||||
if question == nil or question == "" then
|
||||
return true
|
||||
end
|
||||
if not require("avante").toggle() then return false end
|
||||
if question == nil or question == "" then return true end
|
||||
vim.api.nvim_exec_autocmds("User", { pattern = "AvanteInputSubmitted", data = { request = question } })
|
||||
return true
|
||||
end
|
||||
@@ -36,9 +30,7 @@ end
|
||||
---@param question? string
|
||||
M.edit = function(question)
|
||||
local _, selection = require("avante").get()
|
||||
if not selection then
|
||||
return
|
||||
end
|
||||
if not selection then return end
|
||||
selection:create_editing_input()
|
||||
if question ~= nil or question ~= "" then
|
||||
vim.api.nvim_exec_autocmds("User", { pattern = "AvanteEditSubmitted", data = { request = question } })
|
||||
@@ -53,23 +45,15 @@ end
|
||||
|
||||
M.refresh = function()
|
||||
local sidebar = require("avante").get()
|
||||
if not sidebar then
|
||||
return
|
||||
end
|
||||
if not sidebar:is_open() then
|
||||
return
|
||||
end
|
||||
if not sidebar then return end
|
||||
if not sidebar:is_open() then return end
|
||||
local curbuf = vim.api.nvim_get_current_buf()
|
||||
|
||||
local focused = sidebar.result.bufnr == curbuf or sidebar.input.bufnr == curbuf
|
||||
if focused or not sidebar:is_open() then
|
||||
return
|
||||
end
|
||||
if focused or not sidebar:is_open() then return end
|
||||
local listed = vim.api.nvim_get_option_value("buflisted", { buf = curbuf })
|
||||
|
||||
if Utils.is_sidebar_buffer(curbuf) or not listed then
|
||||
return
|
||||
end
|
||||
if Utils.is_sidebar_buffer(curbuf) or not listed then return end
|
||||
|
||||
local curwin = vim.api.nvim_get_current_win()
|
||||
|
||||
@@ -81,7 +65,7 @@ end
|
||||
|
||||
return setmetatable(M, {
|
||||
__index = function(t, k)
|
||||
local module = require("avante")
|
||||
local module = require "avante"
|
||||
---@class AvailableApi: ApiCaller
|
||||
---@field api? boolean
|
||||
local has = module[k]
|
||||
|
||||
Reference in New Issue
Block a user