Add undo command

Do not insert text in command mode
This commit is contained in:
Francesco Abbate 2021-03-24 11:23:04 +01:00
parent b0438b60dc
commit 3f4856bccd
2 changed files with 6 additions and 2 deletions

View File

@ -284,7 +284,9 @@ end
function DocView:on_text_input(text)
self.doc:text_input(text)
if self.editing_mode ~= 'command' then
self.doc:text_input(text)
end
end

View File

@ -28,7 +28,7 @@ local function table_find(t, e)
end
keymap.vim_verbs_obj = {'d', 'c'}
keymap.vim_verbs_imm = {'y', 'p', 'h', 'j', 'k', 'l', 'x', 'i'}
keymap.vim_verbs_imm = {'y', 'p', 'h', 'j', 'k', 'l', 'x', 'i', 'u'}
keymap.vim_objects = {'w', '$'}
local vim_object_map = {
@ -62,6 +62,8 @@ function keymap.vim_execute(verb, mult, object)
command.perform('core:set-insert-mode')
elseif verb == 'p' then
command.perform('doc:paste')
elseif verb == 'u' then
command.perform('doc:undo')
else
return false
end