This commit is contained in:
Christian Nieves
2024-11-25 19:19:16 +00:00
parent 6bdd165942
commit 22d681a3d2
6 changed files with 25 additions and 34 deletions

View File

@ -23,7 +23,7 @@ function M.map(mode, lhs, rhs, opts)
end
function M.file_too_large(filename)
local max_filesize = 100 * 1024 -- 100 KB
local max_filesize = 2000 * 1024 -- 2MB
local ok, stats = pcall(vim.loop.fs_stat, filename)
if ok and stats and stats.size > max_filesize then
return true
@ -31,10 +31,6 @@ function M.file_too_large(filename)
return false
end
function M.buf_too_large()
return M.file_too_large(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()))
end
function M.use_google()
if M.use_google_cache == nil then
M.use_google_cache = M.file_exists(os.getenv("HOME") .. "/use_google")