From 8ba7c64a7da9e46f2ac601919508803824208935 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 19:31:40 +0200 Subject: [PATCH] feat(comments): use ts-comments.nvim instead of nvim-ts-context-commentstring on Neovim 0.10 --- lua/lazyvim/plugins/coding.lua | 20 ++++--------------- .../plugins/extras/coding/mini-comment.lua | 7 +++++++ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 9e623296..c6150347 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -156,22 +156,10 @@ return { -- comments { - "JoosepAlviste/nvim-ts-context-commentstring", - lazy = true, - opts = { - enable_autocmd = false, - }, - init = function() - if vim.fn.has("nvim-0.10") == 1 then - vim.schedule(function() - local get_option = vim.filetype.get_option - vim.filetype.get_option = function(filetype, option) - return option == "commentstring" and require("ts_context_commentstring.internal").calculate_commentstring() - or get_option(filetype, option) - end - end) - end - end, + "folke/ts-comments.nvim", + event = "VeryLazy", + opts = {}, + enabled = vim.fn.has("nvim-0.10") == 1, }, { import = "lazyvim.plugins.extras.coding.mini-comment", diff --git a/lua/lazyvim/plugins/extras/coding/mini-comment.lua b/lua/lazyvim/plugins/extras/coding/mini-comment.lua index d401c9de..457787ef 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-comment.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-comment.lua @@ -10,4 +10,11 @@ return { }, }, }, + { + "JoosepAlviste/nvim-ts-context-commentstring", + lazy = true, + opts = { + enable_autocmd = false, + }, + }, }