diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-24 16:00:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-24 16:00:39 +0800 |
commit | 13123693e692c6bcf1703e2ec4538d940cdc9d2c (patch) | |
tree | 94c6ffef8c16ede449e3d6c40e3d2b96fe059195 /script/text-merger.lua | |
parent | 73fb24d0f9d085f0f7bda7991f20f0388bab8f7e (diff) | |
download | lua-language-server-13123693e692c6bcf1703e2ec4538d940cdc9d2c.zip |
fix test
Diffstat (limited to 'script/text-merger.lua')
-rw-r--r-- | script/text-merger.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/script/text-merger.lua b/script/text-merger.lua index 4840f935..ac3fd765 100644 --- a/script/text-merger.lua +++ b/script/text-merger.lua @@ -23,16 +23,16 @@ local function getLeft(text, char) if not text then return '' end - local offsetEncoding = getOffsetEncoding() + local encoding = getOffsetEncoding() local left - local length = encoder.len(offsetEncoding, text) + local length = encoder.len(encoding, text) if char == 0 then left = '' elseif char >= length then left = text else - left = text:sub(1, encoder.offset(offsetEncoding, text, char + 1) - 1) + left = text:sub(1, encoder.offset(encoding, text, char + 1) - 1) end return left @@ -42,16 +42,16 @@ local function getRight(text, char) if not text then return '' end - local offsetEncoding = getOffsetEncoding() + local encoding = getOffsetEncoding() local right - local length = encoder.len(offsetEncoding, text) + local length = encoder.len(encoding, text) if char == 0 then right = text elseif char >= length then right = '' else - right = text:sub(encoder.offset(offsetEncoding, text, char + 1)) + right = text:sub(encoder.offset(encoding, text, char + 1)) end return right |