From c38d602b888a95a4b3b7a3b4241ce5b3e434eb35 Mon Sep 17 00:00:00 2001 From: rhcher <2032877541@qq.com> Date: Sun, 9 Jan 2022 16:49:37 +0800 Subject: feat(filetype.lua): fix .cc file not detected --- runtime/lua/vim/filetype.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 83e4a20ef7..3423be40f9 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -119,7 +119,13 @@ local extension = { tcc = "cpp", hxx = "cpp", hpp = "cpp", - cpp = function() + cpp = function(path, bufnr) + if vim.g.cynlib_syntax_for_cc then + return "cynlib" + end + return "cpp" + end, + cc = function(path, bufnr) if vim.g.cynlib_syntax_for_cc then return "cynlib" end -- cgit