Do not allow repeating last insert when we are not in normal mode

<a-;>. is not accepted anymore. Note that <a-;> are not repeatable
currently anyway (That could be fixed, athough not trivial).
Fixes #1469
This commit is contained in:
Maxime Coste 2017-06-27 09:57:10 +01:00
parent ce8078ad73
commit 641acc5943
6 changed files with 9 additions and 1 deletions

View File

@ -1430,6 +1430,9 @@ void InputHandler::repeat_last_insert()
if (m_last_insert.keys.empty()) if (m_last_insert.keys.empty())
return; return;
if (dynamic_cast<InputModes::Normal*>(&current_mode()) == nullptr)
throw runtime_error{"repeating last insert not available in this context"};
Vector<Key> keys; Vector<Key> keys;
swap(keys, m_last_insert.keys); swap(keys, m_last_insert.keys);
ScopedSetBool disable_hooks(context().hooks_disabled(), ScopedSetBool disable_hooks(context().hooks_disabled(),

View File

@ -0,0 +1 @@
i<a-;>!echo tchou<ret><a-;>.

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,2 @@
tchou

View File

@ -0,0 +1 @@

View File

@ -19,7 +19,7 @@ main() {
eval -buffer *debug* write debug eval -buffer *debug* write debug
quit! quit!
} }
exec "%sh{cat cmd}" try %{ exec "%sh{cat cmd}" }
exec <c-l> exec <c-l>
eval -buffer *debug* write debug eval -buffer *debug* write debug
nop %sh{ nop %sh{