diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/config.lua | 1 | ||||
-rw-r--r-- | script/core/guide.lua | 11 | ||||
-rw-r--r-- | script/proto/define.lua | 3 |
3 files changed, 11 insertions, 4 deletions
diff --git a/script/config.lua b/script/config.lua index a133cf1c..8bc05b98 100644 --- a/script/config.lua +++ b/script/config.lua @@ -176,6 +176,7 @@ local ConfigTemplate = { viewNumber = {true, Boolean}, fieldInfer = {3000, Integer}, previewFields = {100, Integer}, + enumsLimit = {5, Integer}, }, color = { mode = {'Semantic', String}, diff --git a/script/core/guide.lua b/script/core/guide.lua index b80a3628..367b91e2 100644 --- a/script/core/guide.lua +++ b/script/core/guide.lua @@ -1,4 +1,6 @@ local util = require 'utility' +local config = require 'config' +local lang = require 'language' local error = error local type = type local next = next @@ -3396,7 +3398,14 @@ function m.mergeTypes(types) end end) - return tableConcat(results, '|') + local enumsLimit = config.config.hover.enumsLimit + if #results > enumsLimit then + return tableConcat(results, '|', 1, enumsLimit) + .. lang.script('HOVER_MORE_ENUMS', #results - enumsLimit) + else + return tableConcat(results, '|') + end + end function m.getClassExtends(class) diff --git a/script/proto/define.lua b/script/proto/define.lua index 15e434de..abfaa9b0 100644 --- a/script/proto/define.lua +++ b/script/proto/define.lua @@ -1,6 +1,3 @@ -local guide = require 'core.guide' -local util = require 'utility' - local m = {} ---@alias location table |