Skip to content

Commit

Permalink
fix: unclarity of keymaps in replace-confirm window (#11) (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser authored Aug 9, 2023
1 parent e576851 commit 5f43976
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lua/ssr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <CR>
keymap.set("n", "<CR>", "<Nop>", { buffer = confirm_buf })

local function map(key, func)
keymap.set("n", key, function()
func()
Expand Down

0 comments on commit 5f43976

Please sign in to comment.