Fix multibyte character problem

This commit is contained in:
hrsh7th
2021-08-26 18:08:04 +09:00
parent f5c0772562
commit 600c6c9cc2
3 changed files with 17 additions and 5 deletions

View File

@@ -135,6 +135,15 @@ str.get_word = function(text, stop_char)
return text
end
---Get character length.
---@param text string
---@param s number
---@param e number
---@return number
str.chars = function(text, s, e)
return vim.fn.strchars(string.sub(text, s, e))
end
---Oneline
---@param text string
---@return string