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:
Aaron Pham
2024-09-03 04:19:54 -04:00
committed by GitHub
parent 4ad913435c
commit e8c71d931e
28 changed files with 608 additions and 1181 deletions

View File

@@ -1,17 +1,17 @@
if vim.fn.has("nvim-0.10") == 0 then
if vim.fn.has "nvim-0.10" == 0 then
vim.api.nvim_echo({
{ "Avante requires at least nvim-0.10", "ErrorMsg" },
{ "Please upgrade your neovim version", "WarningMsg" },
{ "Press any key to exit", "ErrorMsg" },
}, true, {})
vim.fn.getchar()
vim.cmd([[quit]])
vim.cmd [[quit]]
end
--- NOTE: We will override vim.paste if img-clip.nvim is available to work with avante.nvim internal logic paste
local Clipboard = require("avante.clipboard")
local Config = require("avante.config")
local Clipboard = require "avante.clipboard"
local Config = require "avante.config"
if Config.support_paste_image(true) then
vim.paste = (function(overriden)
@@ -22,17 +22,13 @@ if Config.support_paste_image(true) then
local bufnr = vim.api.nvim_get_current_buf()
local filetype = vim.api.nvim_get_option_value("filetype", { buf = bufnr })
if filetype ~= "AvanteInput" then
return overriden(lines, phase)
end
if filetype ~= "AvanteInput" then return overriden(lines, phase) end
---@type string
local line = lines[1]
local ok = Clipboard.paste_image(line)
if not ok then
return overriden(lines, phase)
end
if not ok then return overriden(lines, phase) end
-- After pasting, insert a new line and set cursor to this line
vim.api.nvim_buf_set_lines(bufnr, -1, -1, false, { "" })