Skip to content

Commit eac4855

Browse files
committed
fix: use math.huge instead of div by zero
1 parent 6e4f775 commit eac4855

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/null-ls/helpers/diagnostics.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ local make_diagnostic = function(entries, defaults, attr_adapters, params, offse
6868
-- we need to convert the column number to a byte index.
6969
-- See: https://github.com/nvimtools/none-ls.nvim/issues/19#issuecomment-1820127436
7070
if entries["col"] ~= nil and content_line ~= nil then
71-
local col = tonumber(entries["col"]) or (1 / 0)
71+
local col = tonumber(entries["col"]) or math.huge
7272
col = math.min(col, string.len(content_line))
7373
local byte_index_col = vim.str_byteindex(content_line, col)
7474
entries["col"] = tostring(byte_index_col)

0 commit comments

Comments
 (0)