From 5b532d8190eeffa82ce83a02cfc25c0deff16d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 28 Aug 2023 19:16:52 +0200 Subject: [PATCH] Fix teaching.lua even more --- nvim/lua/teaching.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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()