From 359a286aeacb0b8f4a725d88d9c1b853a752e53e Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 15 May 2022 08:12:09 +0530 Subject: [PATCH] fix comment.nvim visual commenting not working (#1081) --- lua/core/mappings.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index aabcc78..ad0d2d6 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -80,12 +80,18 @@ M.comment = { -- toggle comment in both modes n = { - ["/"] = { " lua require('Comment.api').toggle_current_linewise()", "蘒 toggle comment" }, + ["/"] = { + function() + require("Comment.api").toggle_current_linewise() + end, + + "蘒 toggle comment", + }, }, v = { ["/"] = { - " lua require('Comment.api').toggle_current_linewise_op(vim.fn.visualmode())", + "lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())", "蘒 toggle comment", }, },