diff --git a/nvim/lua/teaching.lua b/nvim/lua/teaching.lua index d0a54b0..24f5360 100644 --- a/nvim/lua/teaching.lua +++ b/nvim/lua/teaching.lua @@ -12,14 +12,23 @@ local function should_load(path) [4] = "third-party", [5] = "sfml", } + local match = { + [1] = ".hpp", + [2] = ".h", + [3] = ".cpp", + [4] = ".c", + } for _, pattern in ipairs(ignore) do if string.find(path, pattern, 0, true) then return false end end - if ends_with(path, ".h") or ends_with(path, ".cpp") or ends_with(path, ".cpp") or ends_with(path, ".cpp") then - return true + for _, pattern in ipairs(match) do + if ends_with(path, pattern) then + return true + end end + return false end function teaching.load()