Skip to content

Commit

Permalink
Merge pull request #23 from Diogo-ss/dev
Browse files Browse the repository at this point in the history
fix: bad commentstring in Neovim 0.11 nightly
  • Loading branch information
Diogo-ss authored Sep 4, 2024
2 parents aa72016 + 29bdf78 commit f546cfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/42header/utils/header.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ end
function M.comment_symbols()
local str = vim.api.nvim_buf_get_option(0, "commentstring")

if vim.tbl_contains({ "c", "cc", "cpp", "cxx", "tpp" }, vim.bo.filetype) then
str = "/* %s */"
end

-- Checks the buffer has a valid commentstring.
if str:find "%%s" then
local left, right = str:match "(.*)%%s(.*)"
Expand Down

0 comments on commit f546cfa

Please sign in to comment.