From 19d544e3832d573183e6185ec82e5e67d1f93437 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 24 Aug 2022 22:47:43 -0700 Subject: [PATCH 1/3] remove lockmarks (resolves numToStr/Comment.nvim#219) --- lua/Comment/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/Comment/api.lua b/lua/Comment/api.lua index d9b75c96..861719d0 100644 --- a/lua/Comment/api.lua +++ b/lua/Comment/api.lua @@ -478,7 +478,7 @@ api.locked = setmetatable({}, { ---@param motion OpMotion return function(motion) return A.nvim_command( - ('lockmarks lua require("Comment.api").%s(%s)'):format(cb, motion and ('%q'):format(motion)) + ('lua require("Comment.api").%s(%s)'):format(cb, motion and ('%q'):format(motion)) ) end end, From bb731f51f1fd8790acab1ef121cf5d1116b7bae3 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 00:10:02 -0700 Subject: [PATCH 2/3] Revert "remove lockmarks (resolves numToStr/Comment.nvim#219)" This reverts commit 19d544e3832d573183e6185ec82e5e67d1f93437. --- lua/Comment/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/Comment/api.lua b/lua/Comment/api.lua index 861719d0..d9b75c96 100644 --- a/lua/Comment/api.lua +++ b/lua/Comment/api.lua @@ -478,7 +478,7 @@ api.locked = setmetatable({}, { ---@param motion OpMotion return function(motion) return A.nvim_command( - ('lua require("Comment.api").%s(%s)'):format(cb, motion and ('%q'):format(motion)) + ('lockmarks lua require("Comment.api").%s(%s)'):format(cb, motion and ('%q'):format(motion)) ) end end, From 89ae1e26978057d2f5c005e74dc9042b4d546872 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 00:37:11 -0700 Subject: [PATCH 3/3] only enable `:lockmarks` for `gcA` Co-authored-by: Benoit de Chezelles <@bew> --- lua/Comment/api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/Comment/api.lua b/lua/Comment/api.lua index d9b75c96..9c99e435 100644 --- a/lua/Comment/api.lua +++ b/lua/Comment/api.lua @@ -555,8 +555,8 @@ function api.setup(config) -- Extra Mappings if cfg.mappings.extra then - K('n', cfg.extra.below, api.locked('insert.linewise.below'), { desc = 'Comment insert below' }) - K('n', cfg.extra.above, api.locked('insert.linewise.above'), { desc = 'Comment insert above' }) + K('n', cfg.extra.below, api.insert.linewise.below, { desc = 'Comment insert below' }) + K('n', cfg.extra.above, api.insert.linewise.above, { desc = 'Comment insert above' }) K('n', cfg.extra.eol, api.locked('insert.linewise.eol'), { desc = 'Comment insert end of line' }) end