Replicate Vim backspace and CTRL-C behaviour (#129)

This commit is contained in:
Robert Štojs 2021-03-25 08:55:48 +01:00 committed by GitHub
parent 9ead6f6427
commit 40d69470fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -154,10 +154,13 @@ function keymap.on_key_pressed(k)
return true
end
elseif mode == 'insert' then
if stroke == 'escape' then
if stroke == 'escape' or stroke == 'ctrl+c' then
core.set_editing_mode(core.active_view, 'command')
return true
end
if stroke == 'backspace' then
command.perform('doc:backspace')
end
return false
end
local commands = keymap.map[stroke]