FakeVim: Don't handle user mapping in some commands

Don't handle user mappings in commands that cannot be followed by
movement command. For example, key "<SPACE>" in after "t" command cannot
be handled as user mapping.

Change-Id: I97582d23ae637b30b1058b9d2b381a869bbebb79
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hluk
2013-04-02 17:56:12 +02:00
committed by hjk
parent 7b885b583d
commit 4fc706d7e0
2 changed files with 18 additions and 1 deletions

View File

@@ -2489,7 +2489,15 @@ void FakeVimHandler::Private::endMapping()
bool FakeVimHandler::Private::canHandleMapping()
{
return m_subsubmode != SearchSubSubMode
// Don't handle user mapping in sub-modes that cannot be followed by movement and in "noremap".
return m_subsubmode == NoSubSubMode
&& m_submode != RegisterSubMode
&& m_submode != WindowSubMode
&& m_submode != ZSubMode
&& m_submode != CapitalZSubMode
&& m_submode != ReplaceSubMode
&& m_submode != MacroRecordSubMode
&& m_submode != MacroExecuteSubMode
&& (g.mapStates.isEmpty() || !g.mapStates.last().noremap);
}