From 3e038cb8f25a6b8171a7db27489986c1359919c5 Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Sat, 28 Jun 2025 07:39:45 -0400 Subject: [PATCH] chore: enable comment pre_hook --- .config/nvim/lua/plugins/comment.lua | 7 ++++++- .config/nvim/lua/plugins/treesitter/ts-commentstring.lua | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua index d03d0e2..5f749f8 100644 --- a/.config/nvim/lua/plugins/comment.lua +++ b/.config/nvim/lua/plugins/comment.lua @@ -1,5 +1,8 @@ return { 'numToStr/Comment.nvim', + dependencies = { + 'JoosepAlviste/nvim-ts-context-commentstring', + }, event = { 'BufReadPre', 'BufNewFile' }, opts = { padding = true, @@ -24,7 +27,9 @@ return { basic = true, extra = true, }, - pre_hook = nil, + pre_hook = function() + require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook() + end, post_hook = nil, }, } \ No newline at end of file diff --git a/.config/nvim/lua/plugins/treesitter/ts-commentstring.lua b/.config/nvim/lua/plugins/treesitter/ts-commentstring.lua index 25629a3..b0d43b9 100644 --- a/.config/nvim/lua/plugins/treesitter/ts-commentstring.lua +++ b/.config/nvim/lua/plugins/treesitter/ts-commentstring.lua @@ -1,9 +1,11 @@ return { 'JoosepAlviste/nvim-ts-context-commentstring', - enabled = true, - dependencies = { 'numToStr/Comment.nvim' }, + dependencies = { + 'numToStr/Comment.nvim', + 'nvim-treesitter/nvim-treesitter', + }, event = 'VeryLazy', opts = { enable_autocmd = false, }, -} +} \ No newline at end of file