Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Hook Insert/NormalIdle not executing command until first keypress #5098

Open
sdothum opened this issue Feb 3, 2024 · 0 comments
Open
Labels

Comments

@sdothum
Copy link

sdothum commented Feb 3, 2024

Version of Kakoune

v2023.08.05

Reproducer

Nothing complicated..

```

hook global WinCreate .* %{
normal-mode-colorscheme
hook window ModeChange (push|pop):.:insert insert-mode-colorscheme
hook window ModeChange (push|pop):insert:.
normal-mode-colorscheme
hook window InsertIdle .* capslock-check
hook window NormalIdle .* capslock-check
}

capslock-check checks the capslock status and sets the colorscheme to the capslock scheme if on (and reverts back to the correct modal theme if off).


### Outcome

The appropriate theme is toggled on enabling the capslock. The capslock state (configured) is shown immediately on the statusline BUT the appropriate colorscheme does not show until the first keypress subsequent to togging the capslock key.

### Expectations

Expecting the hook to immediately effect the colorscheme change of capslock state.

### Additional information

I inserted a %sh{echo "capslocks on" >>/tmp/kak:trace} statement into the capslock-check command hook and, indeed, togging the capslock does not issue the trace message until the first keypress after toggling the capslock. It's as if the hook action is queued and doesn't trigger until the keypress.

This happens with no plugins loaded as well. Running on Alpine Linux 3.19 (latest stable).
@sdothum sdothum added the bug label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant