From 052ceb3a61222eb525839d075fcf33cf9e7189c3 Mon Sep 17 00:00:00 2001 From: Arcanox Date: Sat, 25 Sep 2021 18:01:10 -0500 Subject: Fix a crash when deleting lines from a file while anything is analyzing it (something might try and analyze beyond the new end of the file) --- script/proto/converter.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/proto/converter.lua b/script/proto/converter.lua index 19d592fe..0cae230e 100644 --- a/script/proto/converter.lua +++ b/script/proto/converter.lua @@ -12,7 +12,11 @@ local function rawPackPosition(uri, pos) local text = files.getText(uri) if text then local lineOffset = state.lines[row] - col = utf8.len(text, lineOffset, lineOffset + col - 1, true) + if lineOffset then + col = utf8.len(text, lineOffset, lineOffset + col - 1, true) + else + col = 0 + end end end return { -- cgit v1.2.3