Skip to content

Commit 6d94c2a

Browse files
pysan3vhyrro
authored andcommitted
fix(syntax): ignore type annotation errors in syntax module
1 parent 27482dc commit 6d94c2a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lua/neorg/modules/core/syntax/module.lua

+4-9
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,8 @@ module.public = {
264264
local foldenable = vim.o.foldenable
265265
local foldminlines = vim.o.foldminlines
266266
if vim.b.current_syntax ~= "" or vim.b.current_syntax ~= nil then
267-
vim.b.current_syntax = lang_name
268-
current_syntax = vim.b.current_syntax
269-
vim.b.current_syntax = nil
267+
current_syntax = lang_name
268+
vim.b.current_syntax = nil ---@diagnostic disable-line
270269
end
271270

272271
-- include the cluster that will put inside the region
@@ -326,11 +325,7 @@ module.public = {
326325

327326
-- reset some values after including
328327
vim.bo[buf].iskeyword = is_keyword
329-
if current_syntax ~= "" or current_syntax ~= nil then
330-
vim.b.current_syntax = current_syntax
331-
else
332-
vim.b.current_syntax = ""
333-
end
328+
vim.b.current_syntax = current_syntax or "" ---@diagnostic disable-line
334329

335330
has_syntax = string.format("syntax list %s", snip)
336331
--- @type boolean, string|{ output: string }
@@ -372,7 +367,7 @@ module.public = {
372367
vim.o.foldminlines = foldminlines
373368
end
374369

375-
vim.b.current_syntax = ""
370+
vim.b.current_syntax = "" ---@diagnostic disable-line
376371
module.private.last_buffer = vim.api.nvim_buf_get_name(buf)
377372
end
378373
end

0 commit comments

Comments
 (0)