Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
610 stars 28 forks source link

Insane lag when editing Fennel in Markdown code blocks #53

Closed enderger closed 3 years ago

enderger commented 3 years ago

For some reason, editing Fennel embedded in a Markdown code block produces large amounts of lag. lag-example I don't quite know what causes this, but I can say that it gets worse quickly.

Olical commented 3 years ago

Hey there, would you be able to elaborate a bit here? I can't reproduce this at all.

Conjure doesn't run or even load in markdown files, so I presume you're using some plugin to embed filetypes within other filetypes (through TreeSitter?) and I guess that's having some weird interaction with Conjure.

I would guess your autocomplete is running, failing and consuming a lot of CPU, but that's a wild guess. Any plugins you're using to do this would be useful for reproduction. Thanks!

Olical commented 3 years ago

If you could try turning off Conjure's completion etc (see the :help files) and see if the problem goes away, that'd be really good! And if you're using tree sitter, you can enable the experimental treesitter form extraction code, again, in :help conjure if you have a grep for treesitter.

Olical commented 3 years ago

Oh I assumed this was Conjure, if you're only using Aniseed then I don't see how this would make a difference, Aniseed has no interactive components whatsoever, so I doubt it's Aniseed at all in that case.

enderger commented 3 years ago

Unfortunately, disabling Aniseed appears to fix the problem, as does switching into Clojure mode. I presume that Aniseed tries to load something more than just syntax highlighting when embedded in Markdown, causing lag on failure.

Olical commented 3 years ago

I can't reproduce this at all though, if I have a code block in markdown it's just unhighlighted code, so I presume you have a plugin to enable sub-language support in buffers? That leans on TreeSitter somehow?

I'm afraid I won't be able to reproduce this until I can reproduce the exact setup you're using. I would imagine it's to do with how your language-in-language thing is implemented but I can't be sure.

Maybe disabling omnicompletion support will help?

let g:conjure#completion#omnifunc = v:null
enderger commented 3 years ago

Ok, forgot I had Polyglot providing Markdown support. If vim-markdown is installed and the following is set, the issue should occur.

(set nvim.g.markdown_fenced_languages ["fennel"])
Olical commented 3 years ago

Hmm, huge guess but is this issue related perhaps? https://github.com/plasticboy/vim-markdown/issues/162 they mention setting let g:vim_markdown_folding_disabled = 1 (presumably at startup before you enter the markdown buffer)

Does that magically fix the issue?

enderger commented 3 years ago

Unfortunately not.

Olical commented 3 years ago

I think this is related to the mentioned Conjure issue, it's really something to do with readline being installed alongside fennel and running the REPL in a headless environment. I'm not sure why, but I've set the recommended TERM=dumb environment variable on the develop branch of Conjure now.

Updating to that should fix your problem since it seems like you were running into the exact same thing. If this is no longer an issue for you due to it being fixed or not using the tooling any more please feel free to close it. Thanks!

Olical commented 3 years ago

I'm going to close this assuming that my recent work fixed it and it wasn't to do with markdown, but readline slowing things down for some unknown reason.

Please feel free to reopen if you've updated everything and you're still having this issue. I'll try to reproduce it and get to the bottom of it.