From 17bdb91ed22f4b6378f88c1791d0b85a37142d1a Mon Sep 17 00:00:00 2001 From: Will Dean Date: Tue, 4 Feb 2025 12:51:19 +0100 Subject: [PATCH] pass the mode to mapping --- lua/octo/utils.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lua/octo/utils.lua b/lua/octo/utils.lua index 35d0a227..b0764a8f 100644 --- a/lua/octo/utils.lua +++ b/lua/octo/utils.lua @@ -1658,11 +1658,8 @@ function M.apply_mappings(kind, bufnr) value.desc = "" end local mapping_opts = { silent = true, noremap = true, buffer = bufnr, desc = value.desc } - vim.keymap.set("n", value.lhs, mappings[action], mapping_opts) - -- TODO: These should probably be part of the config - if action == "add_review_comment" or action == "add_review_suggestion" then - vim.keymap.set("x", value.lhs, mappings[action], mapping_opts) - end + local mode = value.mode or "n" + vim.keymap.set(mode, value.lhs, mappings[action], mapping_opts) end end end