Skip to content

Commit

Permalink
Merge pull request hadronized#280 from ii14/fix_ctrl_c
Browse files Browse the repository at this point in the history
fix: make ctrl-c equivalent to esc in :HopPattern prompt
  • Loading branch information
hadronized authored Jul 18, 2022
2 parents 6bcaeb7 + afaec06 commit 4261a6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/hop/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ local function get_input_pattern(prompt, maxchar, opts)
vim.api.nvim_echo({{prompt, 'Question'}, {pat}}, false, {})

local ok, key = pcall(vim.fn.getchar)
if not ok then break end -- Interrupted by <C-c>
if not ok then -- Interrupted by <C-c>
pat = nil
break
end

if type(key) == 'number' then
key = vim.fn.nr2char(key)
Expand Down

0 comments on commit 4261a6c

Please sign in to comment.