Skip to content

Commit

Permalink
fix previous bug for dot repeatable
Browse files Browse the repository at this point in the history
  • Loading branch information
alex.tylor committed Jun 2, 2021
1 parent 8a646db commit 22f81f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/nvim_comment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function M.setup(user_opts)

if M.config.create_mappings then
local opts = {noremap = true, silent = true}
vim.api.nvim_set_keymap("n", M.config.line_mapping, ":set operatorfunc=CommentOperator<cr>g@", opts)
vim.api.nvim_set_keymap("n", M.config.line_mapping, ":normal " .. M.config.operator_mapping .. "l<CR>", opts)
vim.api.nvim_set_keymap("n", M.config.operator_mapping, ":set operatorfunc=CommentOperator<cr>g@", opts)
vim.api.nvim_set_keymap("v", M.config.operator_mapping, ":<c-u>call CommentOperator(visualmode())<cr>", opts)
end
Expand Down
4 changes: 2 additions & 2 deletions tests/comment_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ end

setUpBuffer(input, "lua")
-- comment
runCommandAndAssert(1, "gcl", expected)
runCommandAndAssert(1, "gcc", expected)
-- uncomment
runCommandAndAssert(1, "gcl", input)
runCommandAndAssert(1, "gcc", input)
-- comment, via dot
runCommandAndAssert(1, ".", expected)
end)
Expand Down

0 comments on commit 22f81f9

Please sign in to comment.