Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit 3eef2b2

Browse files
update(install): add warning message
Add warning message before installing large docs
1 parent 33ce6a2 commit 3eef2b2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lua/nvim-devdocs/operations.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ M.install = function(entry, verbose, is_update)
5252
if not is_update and is_installed then
5353
if verbose then notify.log("Documentation for " .. alias .. " is already installed") end
5454
else
55+
local ui = vim.api.nvim_list_uis()
56+
57+
if ui[1] and entry.db_size > 10000000 then
58+
local input = vim.fn.input({
59+
prompt = "Building large docs can freeze neovim, continue? y/n ",
60+
})
61+
62+
if input ~= "y" then return end
63+
end
64+
5565
local callback = function(index)
5666
local doc_url = string.format("%s/%s/db.json?%s", devdocs_cdn_url, entry.slug, entry.mtime)
5767

0 commit comments

Comments
 (0)