mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.87k stars 712 forks source link

Insert{Char,Key} hook does not respect \ #3632

Open Parasrah opened 4 years ago

Parasrah commented 4 years ago

Steps

git revision: 6fa26b8dd2ac0931fe688370728c47086277d883

define-command enter-test-mode %{
    hook -group kak-test global InsertChar .* %{
        execute-keys -draft %sh{
            key=$kak_hook_param
            printf %s "<a-;>\i${key}"
        }
    }
}

define-command leave-test-mode %{
    remove-hooks global kak-test
}

Outcome

Expected

lenormf commented 4 years ago

Did you try escaping the semicolon? <a-semicolon>.

Parasrah commented 4 years ago

Do you mean updating to the following?

define-command enter-test-mode %{
    hook -group kak-test global InsertChar .* %{
        execute-keys -draft %sh{
            key=$kak_hook_param
            printf %s "<a-semicolon>\i${key}"
        }
    }
}

It still seems to act the same way. I think the issue lies in \i${key} is still triggering the current hook despite the \. I've also tried with <esc>\i${key} and it acts the same way