Skip to content

Commit 790b044

Browse files
authored
Add clause for the nil case in the treesitter module (#1718)
The nil case wasn't being handled which led to thrown errors in some edge cases.
1 parent e8e8b98 commit 790b044

File tree

1 file changed

+1
-1
lines changed
  • lua/neorg/modules/core/integrations/treesitter

1 file changed

+1
-1
lines changed

lua/neorg/modules/core/integrations/treesitter/module.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ module.public = {
666666
if type(src) == "string" then
667667
parser = vim.treesitter.get_string_parser(src, filetype)
668668
else
669-
if src ~= 0 then
669+
if src ~= 0 and src ~= nil then
670670
vim.fn.bufload(src)
671671
end
672672
parser = vim.treesitter.get_parser(src or 0, filetype)

0 commit comments

Comments
 (0)