From 5f4397662702eefbea93062e4e3e0811fa55100d Mon Sep 17 00:00:00 2001 From: pseudometa <73286100+chrisgrieser@users.noreply.github.com> Date: Wed, 9 Aug 2023 04:17:52 +0200 Subject: [PATCH] fix: unclarity of keymaps in replace-confirm window (#11) (#27) --- lua/ssr.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/ssr.lua b/lua/ssr.lua index 839d9f9..3c309a0 100644 --- a/lua/ssr.lua +++ b/lua/ssr.lua @@ -247,12 +247,12 @@ function Ui:replace_confirm() local confirm_buf = api.nvim_create_buf(false, true) api.nvim_buf_set_lines(confirm_buf, 0, -1, true, { - "• Yes", - "• No", + "[y]es", + "[n]o", "──────────────", - "• All", - "• Quit", - "• Last replace", + "[a]ll", + "[q]uit", + "[l]ast replace", }) local replaced = 0 @@ -279,6 +279,9 @@ function Ui:replace_confirm() confirm_win = api.nvim_open_win(confirm_buf, true, cfg) end + -- prevent accidental attempt to make a selection with + keymap.set("n", "", "", { buffer = confirm_buf }) + local function map(key, func) keymap.set("n", key, function() func()