hadronized / kak-tree-sitter

tree-sitter meets Kakoune
Other
76 stars 12 forks source link

Freeze on a specific JS file #192

Closed postsolar closed 10 months ago

postsolar commented 10 months ago

KTS version: kak-tree-sitter 0.5.2-dev-7bb2a67

There's a specific JS file on which my Kakoune session freezes as soon as I make any movement in the buffer (e.g. press j, k, e, etc). Interacting with Kakoune in other ways (e.g. the prompt) does not cause freezes. Trying to clear dead sessions afterwards makes that command freeze, as well as trying to connect to frozen session. I have tried it with an empty config file and empty autoload folder as well (just the KTS startup command). Kakoune version is current master.

This file is my config for a GTK widgets lib and isn't suspicious in any way. It behaves fine with Helix and with tree-sitter-cli.

Attached is this file, with changed extension (Github doesn't let .js in). config.txt

Please look if you can reproduce it, that's very weird indeed

hadronized commented 10 months ago

Nope, I can’t reproduce on my system.

Screenshot 2023-12-04 at 22 46 18
hadronized commented 10 months ago

May you try to:

  1. Compile Kakoune in debug mode.
  2. Open that file to reproduce the bug.
  3. Use gdb to attach to the pid of Kakoune, and provide a backtrace.

Also, which operating system are you using?

postsolar commented 10 months ago

It might be due to Kakoune standard modules acting on code on buffer initialization.

https://github.com/mawww/kakoune/blob/7f49395cf931b2af8a75ffb5319a8aa8c395ed8d/rc/filetype/javascript.kak#L15-L22

In fact if I turn off everything but the standard modules then this file "starts" with an edit history🤯. I didn't even know it's a thing. Anyways, if I disable standard modules loading then it's fine and KTS works as usual, so probably unrelated to KTS.

hadronized commented 10 months ago

Okay, feel free to reopen if that happens again!