conjure icon indicating copy to clipboard operation
conjure copied to clipboard

Log buffer filetype doesn't get set

Open austinmlv opened this issue 2 years ago • 3 comments

Expected behavior: after opening any Conjure supported source file I should be able to open a log buffer and see Conjure's output highlighted like the file being eval'ed. I should also have all the Conjure mappings available in the log buffer.

Actual behavior: Conjure's log buffer isn't getting the filetype detected despite having the right file extension. I open up a Guile '.scm' file, successfully connect to the repl, <localleader>ls, and then I get a plain text log buffer despite having a filename like conjure-log-1234.scm. Running :set ft? results in an empty string. As such there are no Conjure mappings set for the log buffer, no highlights, etc. However, running evaluations in the source file works as expected. Only filetype related things seem to be affected.

This only seems to happen to me with newer builds of Neovim. I'm running Neovim's master branch. Neovim v0.7.0 doesn't exhibit this behavior.

After playing around with upsert-hidden in buffer.fnl I can remedy this issue by calling nvim.fn.bufload on the newly created buffer.

Is anyone else having this issue? It seems to only affect recent Neovim builds on my machine. For what it's worth, :help bufadd() says that it doesn't load the buffer, therefore wouldn't the filetype settings/hooks not get run for the log buffer? From what I can tell Neovim was running the filetype hooks in earlier builds after running nvim.fn.bufadd and now it's not.

If this is indeed an issue here's a potential fix:

austinmlv avatar Sep 15 '22 19:09 austinmlv

Yes, I think Neovim have introduced a bug or breaking change. Thank you for finding a potential fix, I'll dig into this soon, should get some OSS time this weekend. I've heard this from a few people now but only on unstable / master branch Neovim. I only really run the latest stable release so I haven't noticed this yet myself.

Olical avatar Sep 15 '22 19:09 Olical

Thanks for the reply Olical. I just submitted a potential fix.

austinmlv avatar Sep 15 '22 19:09 austinmlv

Merged, can someone confirm that this is okay now on the develop branch? Thanks!

Olical avatar Sep 17 '22 13:09 Olical