Fork me on GitHub
#conjure
<
2022-09-26
>
lispyclouds07:09:06

Hello! Thanks a lot for new updates and specially the Python one! 😄 Is there a way to disable Conjure for a particular file type? I have it configured to lazy load via packer for clojure, fennel and python but its loading for Rust too somehow and would like to disable that. Thanks!

1
lispyclouds08:09:45

found it! my clojure brain thought lua's table.insert gave a new one after the insertion but nooo 😕 this changed the file types table in place and messed up packer! Esh

Olical09:09:10

So that option works weirdly, it doesn't merge. You need to create your own new list of filetypes you want to support, either by copying the default out of the docs, pasting it into your config and editing it or just building your own up containing only the filetypes you're interested in. The config table is only there AFTER Conjure loads, Conjure's approach here is "let the user set all their config options, then I'll come in and augment / default things where required". Which means if you want to MODIFY that table you have to do it AFTER Conjure loads. You may have worked all of this out already but thought I'd give some background. I considered replacing it with an associative table where you could set g:conjure#filetypes#clojure = v:false for example, but that has it's own downsides. An explicit allowlist actually has some nice features and low surprise amounts I think.

lispyclouds09:09:32

yep! i was trying to make conjure only load for file types i care about: clojure, fennel and python. so didnt really change g:conjure#filetypes. was trying to add python to the list i have with table.insert in packer's ft = ... and the weirdness started as table.insert gives a nil and conjure loaded all the time.

lispyclouds09:09:39

also i ran :lua= vim.g["conjure#filetypes"] and got { "clojure", "fennel", "janet", "hy", "julia", "racket", "scheme", "lua", "lisp", "python", "rust" } seems to be different from the defaults mentioned in :h conjure?

Olical09:09:30

Ah oops, it might need resyncronising! I probably haven't added the new clients.

Olical09:09:26

Fixed on develop.

1