Skip to content

Commit

Permalink
fix: Comment on single line selects two lines (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubbortlik authored Sep 14, 2024
1 parent 1c99943 commit ad7b866
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/gitlab/reviewer/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ local set_keymaps = function(bufnr, keymaps)
if keymaps.reviewer.create_comment ~= false then
-- Set keymap for repeated operator keybinding
vim.keymap.set("o", keymaps.reviewer.create_comment, function()
vim.api.nvim_cmd({ cmd = "normal", bang = true, args = { tostring(vim.v.count1) .. "j" } }, {})
vim.api.nvim_cmd({ cmd = "normal", bang = true, args = { tostring(vim.v.count1) .. "$" } }, {})
end, {
buffer = bufnr,
desc = "Create comment for [count] lines",
Expand Down Expand Up @@ -333,7 +333,7 @@ local set_keymaps = function(bufnr, keymaps)
if keymaps.reviewer.create_suggestion ~= false then
-- Set keymap for repeated operator keybinding
vim.keymap.set("o", keymaps.reviewer.create_suggestion, function()
vim.api.nvim_cmd({ cmd = "normal", bang = true, args = { tostring(vim.v.count1) .. "j" } }, {})
vim.api.nvim_cmd({ cmd = "normal", bang = true, args = { tostring(vim.v.count1) .. "$" } }, {})
end, {
buffer = bufnr,
desc = "Create suggestion for [count] lines",
Expand Down

0 comments on commit ad7b866

Please sign in to comment.