From 6ca94268a35e8f5dc8d6f03bfec596f48696014d Mon Sep 17 00:00:00 2001 From: adachng Date: Thu, 28 May 2026 15:10:20 +0800 Subject: [PATCH] Consider `.cu` and `.cuh` files --- README.md | 2 +- lua/cppassist/utils.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 30c2725..4669ed5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A Neovim plugin that can do sometings like VAssistX. use { 'Kohirus/cppassist.nvim', opt = true, - ft = { "h", "cpp", "hpp", "c", "cc", "cxx" }, + ft = { "h", "cpp", "hpp", "c", "cc", "cxx", "cuda" }, config = function() require("cppassist").setup() end, diff --git a/lua/cppassist/utils.lua b/lua/cppassist/utils.lua index 43b729e..b6ab6c3 100644 --- a/lua/cppassist/utils.lua +++ b/lua/cppassist/utils.lua @@ -104,10 +104,10 @@ function M.ExtensionCmd(extension) else local res = nil local firstch = string.sub(extension, 1, 1) - if firstch == "h" then - res = " -e cpp -e cxx -e c -e cc " - elseif firstch == "c" then - res = " -e h -e hpp -e hxx " + if firstch == "h" or extension == "cuh" then + res = " -e cpp -e cxx -e c -e cc -e cu" + elseif firstch == "c" or extension == "cu" then + res = " -e h -e hpp -e hxx -e cuh" else print("Invalid filetype!") end