Skip to content

f breaks when user define multi stroke keymap start with f. #260

@t9md

Description

@t9md

Continuation of #254
In my current understanding, I can't fix by vmp side, need to improve Atom's keymap system.

This is not only f, theoretically all command which read user input via mini editor affects.

Problem

When user define f j keymap for some command,

'atom-text-editor.vim-mode-plus.normal-mode':
 'f j': 'dev:hello'

Default f(find) command also break. So when I type fa to find a char, it fail, throw error.

Why?

Atom keymap enter pending state when multiple keybinding matches.
When keymap choice was settled, atom replay keystroke.
When atom replaying keystroke it use original event.target.
So for command like f, it change focsed element to read user input from mini-editor, it fail to eat replayed keystroke(Atom don't send keyevent to this newly focused element).

How to fix

Should create issue to atom-keymap.
I'll send PR If I can(need to learn how to test custom atom-keymap in Atom).

What I want is

I think it's also difficult to let atom-keymap check target's focused element change in earch dispatch of keyBoardEvent dispatch.

So as compromise, I want atom-keymap provide API I can write this way.

atom.keymap.updateTarget(newFocusedElement) if atom.keymap.isReplaying()

By manually let atom.keymap know the change of dom focus, replayed keystroke correctly go into new focused element.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions