From 9e721937af962098386cff37803c7aeef4d99367 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Tue, 26 Oct 2021 00:12:16 +0200 Subject: [PATCH] Don't insert `nil` in highlighter lines table When `highlighter:insert_notify` was called, a hole in the array was created. If another call to `highlighter:insert_notify` happened before the hole was filled, a `Position out of bounds` error could have been raised. --- data/core/doc/highlighter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/doc/highlighter.lua b/data/core/doc/highlighter.lua index 4cb703da..c77e1138 100644 --- a/data/core/doc/highlighter.lua +++ b/data/core/doc/highlighter.lua @@ -52,7 +52,7 @@ end function Highlighter:insert_notify(line, n) self:invalidate(line) for i = 1, n do - table.insert(self.lines, line, nil) + table.insert(self.lines, line, false) end end