-
Notifications
You must be signed in to change notification settings - Fork 112
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
'unmap': cannot unmap key that is currently executing #689
Labels
external dependency
Something need to be fixed upstream
Comments
wow how has that bug report not reached me for one month; thanks for reporting this |
Here're the hooks for show and hide
|
krobelus
added a commit
to krobelus/kakoune
that referenced
this issue
Jul 6, 2023
Commits e49c0fb (unmap: fail if the mapping is currently executing, 2023-05-14) 42be005 (map: fail if key is currently executing, 2023-06-24) fixed potential use-after-free issues. By doing so, it broke configurations that in practice have not triggered any crashes[1][2]. For example with, set -remove global autocomplete insert hook global InsertCompletionShow .* %{ map window insert <esc> <c-o> } hook global InsertCompletionHide .* %{ unmap window insert <esc> <c-o> } The execution of the <esc> mapping triggers InsertCompletionHide fails at unmapping. This seems legit and I don't see an obvious alternative way to write it (InsertIdle would not be correct though it would work in practice). Fix the regression by allowing map and unmap again while keeping the mappings alive until garbage collection. This is similar to how we treat hooks and others. To-do: we can probably clean up the KeymapManager a bit. [1]: <kakoune-lsp/kakoune-lsp#689> [2]: <alexherbo2/auto-pairs.kak#60>
krobelus
added a commit
to krobelus/kakoune
that referenced
this issue
Jul 6, 2023
Commits e49c0fb (unmap: fail if the mapping is currently executing, 2023-05-14) 42be005 (map: fail if key is currently executing, 2023-06-24) fixed potential use-after-free issues. By doing so, it broke configurations that in practice have not triggered any crashes[1][2]. For example with, set -remove global autocomplete insert hook global InsertCompletionShow .* %{ map window insert <esc> <c-o> } hook global InsertCompletionHide .* %{ unmap window insert <esc> <c-o> } The execution of the <esc> mapping triggers InsertCompletionHide fails at unmapping. This seems legit and I don't see an obvious alternative way to write it (InsertIdle would not be correct though it would work in practice). Fix the regression by allowing map and unmap again while keeping the mappings alive until garbage collection. This is similar to how we treat hooks and others. Applying map/unmap immediately seems like the most obvious semantics. Alternatively, we could apply them in between key presses. To-do: we can probably clean up the KeymapManager a bit. [1]: <kakoune-lsp/kakoune-lsp#689> [2]: <alexherbo2/auto-pairs.kak#60>
seems legit, mawww/kakoune#4945 proposes a fix |
krobelus
added a commit
to krobelus/kakoune
that referenced
this issue
Jul 8, 2023
Commits e49c0fb (unmap: fail if the mapping is currently executing, 2023-05-14) 42be005 (map: fail if key is currently executing, 2023-06-24) fixed potential use-after-free issues. By doing so, it broke configurations that in practice have not triggered any crashes[1][2]. For example with, set -remove global autocomplete insert hook global InsertCompletionShow .* %{ map window insert <esc> <c-o> } hook global InsertCompletionHide .* %{ unmap window insert <esc> <c-o> } The execution of the <esc> mapping triggers InsertCompletionHide fails at unmapping. This seems legit and I don't see an obvious alternative way to write it (InsertIdle would not be correct though it would work in practice). Fix the regression by allowing map and unmap again while keeping the mappings alive until garbage collection. This is similar to how we treat hooks and others. Applying map/unmap immediately seems like the most obvious semantics. Alternatively, we could apply them in between key presses. To-do: we can probably clean up the KeymapManager a bit. [1]: <kakoune-lsp/kakoune-lsp#689> [2]: <alexherbo2/auto-pairs.kak#60>
krobelus
added a commit
to krobelus/kakoune
that referenced
this issue
Jul 9, 2023
Commits e49c0fb (unmap: fail if the mapping is currently executing, 2023-05-14) 42be005 (map: fail if key is currently executing, 2023-06-24) fixed potential use-after-free issues. By doing so, it broke configurations that in practice have not triggered any crashes[1][2]. For example with, set -remove global autocomplete insert hook global InsertCompletionShow .* %{ map window insert <esc> <c-o> } hook global InsertCompletionHide .* %{ unmap window insert <esc> <c-o> } The execution of the <esc> mapping triggers InsertCompletionHide fails at unmapping. This seems legit and I don't see an obvious alternative way to write it (InsertIdle would not be correct though it would work in practice). Fix the regression by allowing map and unmap again while keeping the mappings alive until garbage collection. This is similar to how we treat hooks and others. Applying map/unmap immediately seems like the most obvious semantics. Alternatively, we could apply them in between key presses. To-do: we can probably clean up the KeymapManager a bit. [1]: <kakoune-lsp/kakoune-lsp#689> [2]: <alexherbo2/auto-pairs.kak#60>
krobelus
added a commit
to krobelus/kakoune
that referenced
this issue
Jul 20, 2023
Commits e49c0fb (unmap: fail if the mapping is currently executing, 2023-05-14) 42be005 (map: fail if key is currently executing, 2023-06-24) fixed potential use-after-free issues. By doing so, it broke configurations that in practice have not triggered any crashes [1] [2]. For example with, set -remove global autocomplete insert hook global InsertCompletionShow .* %{ map window insert <esc> <c-o> } hook global InsertCompletionHide .* %{ unmap window insert <esc> <c-o> } The execution of the <esc> mapping triggers InsertCompletionHide fails at unmapping. This seems legit and I don't see an obvious alternative way to write it (InsertIdle would not be correct though it would work in practice). Fix the regression by allowing map and unmap again while keeping the mappings alive until they have finished executing. Applying map/unmap immediately seems like the most obvious semantics. Alternatively, we could apply them in between key presses. [1]: <kakoune-lsp/kakoune-lsp#689> [2]: <alexherbo2/auto-pairs.kak#60>
Apparently the fix is merged into the main tree, and i haven't had experience any problems yet. Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not really sure if it's directly related to kak-lsp but sometimes completion fails and leaves kakoune unresponsive for mode switch, esc key does not work.
I see the following logs in the debug buffer.
There's another similar issue on autopairs repo alexherbo2/auto-pairs.kak#60 referring to this commit in kakoune tree mawww/kakoune@e49c0fb
Parent commit of the one above, seems not to have this issue and works fine.
The text was updated successfully, but these errors were encountered: