Closed spywhere closed 3 years ago
https://github.com/spywhere/detect-language.nvim/blob/main/lua/detect-language/init.lua#L73-L79
Instead of reading the whole document as lines and check if it's exceed the threshold, try check it from the last line number.
local last_line = fn.line('$') if last_line > threshold then -- exceed limit return end local lines = api.nvim_buf_get_lines(0, 0, last_line, false)
https://github.com/spywhere/detect-language.nvim/blob/main/lua/detect-language/init.lua#L73-L79
Instead of reading the whole document as lines and check if it's exceed the threshold, try check it from the last line number.