(I saw the no longer maintained sign, consider this for documentation purposes or something)
there's an oopsie in strings.strcharpart's fallback function. sub takes start and end positions, and not start and length like vim's strcharpart:
|
if vim.in_fast_event() then |
|
return str:sub(nchar + 1, charlen) |
|
end |
|
return vim.fn.strcharpart(str, nchar, charlen) |
when this fallback function is used, the truncate function can get stuck in an infinite loop whenever the direction is positive and the string is long enough to be truncated. for example, this freezes in a fast state:
truncate("test string", 5, "...", 1)
to fix this, I think the fallback just needs to be: return str:sub(nchar + 1, nchar + charlen)
(I saw the no longer maintained sign, consider this for documentation purposes or something)
there's an oopsie in
strings.strcharpart's fallback function. sub takes start and end positions, and not start and length like vim's strcharpart:plenary.nvim/lua/plenary/strings.lua
Lines 42 to 45 in 74b06c6
when this fallback function is used, the truncate function can get stuck in an infinite loop whenever the direction is positive and the string is long enough to be truncated. for example, this freezes in a fast state:
to fix this, I think the fallback just needs to be:
return str:sub(nchar + 1, nchar + charlen)