summaryrefslogtreecommitdiff
path: root/script/files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/files.lua')
-rw-r--r--script/files.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/files.lua b/script/files.lua
index 4d649b29..29a66d48 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -120,10 +120,15 @@ end
--- 设置文件文本
---@param uri uri
---@param text string
-function m.setText(uri, text, isTrust, instance)
+function m.setText(uri, text, isTrust)
if not text then
return
end
+ if #text > 1024 * 1024 * 100 then
+ local client = require 'client'
+ client.showMessage('Warning', lang.script('WORKSPACE_SKIP_HUGE_FILE', uri))
+ return
+ end
--log.debug('setText', uri)
local create
if not m.fileMap[uri] then