diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-08-20 17:52:06 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-08-20 17:52:06 +0800 |
commit | cb1a412bc7c205c73aec3ef2b1f8f8baf4564fb0 (patch) | |
tree | 1175e6ac7bbf1a0747780b8bad6728b8b4da5b00 /script/provider/markdown.lua | |
parent | fd86458f11ee270884af730a4344ac000265e64e (diff) | |
download | lua-language-server-cb1a412bc7c205c73aec3ef2b1f8f8baf4564fb0.zip |
stash
Diffstat (limited to 'script/provider/markdown.lua')
-rw-r--r-- | script/provider/markdown.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/script/provider/markdown.lua b/script/provider/markdown.lua index 140267d7..3a215f0f 100644 --- a/script/provider/markdown.lua +++ b/script/provider/markdown.lua @@ -15,6 +15,7 @@ function mt:add(language, text) if not text then return end + self._cacheResult = nil if type(text) == 'table' then self[#self+1] = { type = 'markdown', @@ -34,12 +35,16 @@ function mt:add(language, text) end function mt:splitLine() + self._cacheResult = nil self[#self+1] = { type = 'splitline', } end function mt:string() + if self._cacheResult then + return self._cacheResult + end local lines = {} local language = 'md' @@ -97,7 +102,9 @@ function mt:string() end end - return table.concat(lines, '\n') + local result = table.concat(lines, '\n') + self._cacheResult = result + return result end return function () |