Consolidate the 2 `if` statements. You should probably also do `vim.inputState = new InputState();` here too.