Fork me on GitHub
#conjure
<
2020-06-18
>
Anthony Khong04:06:47

@olical, I was trying to upgrade using Plug 'Olical/conjure', {'tag': 'v3.5.0'} as per the README. And I got fatal: invalid reference: v3.5.0. Looking at the releases page, it looks like you tagged it to v3.6.0: https://github.com/Olical/conjure/releases

Olical08:06:52

Good catch, thank you! I've corrected it to v3.5.0, I got mixed up in my version bumping!

Olical10:06:55

No problem! Apologies for the off by one confusion 😅

Olical08:06:27

So that

{
  false 0.3
  true 3
}
behaviour is known and expected. If you're importing nvim values into lua you need to duck type check for a table that looks like this and take the false value if so. Check out :h vim.types for more info on this. Hopefully this is the only roadblock in getting config into g:conjure, I've already paved over it

Olical08:06:37

(defn get-in [ks]
  (let [v (a.get-in (root) ks)]
    (if (and (a.table? v)
             (. v vim.type_idx)
             (. v vim.val_idx))
      (. v vim.val_idx)
      v)))

Olical08:06:19

Hmm, second thought, nested maps are probably awful to work with for setting config in viml.

Olical08:06:18

Counter point: If you're setting config before conjure loads you can just do let g:conjure = { ... } and nest as much as you want. Then if Conjure is already loaded all of the dicts will already be defined, so let g:conjure.foo.bar.baz = ... should be fine too.

Olical10:06:27

I think I have to find a way to have a flat map, so instead of setting g:conjure.foo.bar you’d set g:conjure_foo_bar.

Olical10:06:43

Also the wiki is now editable by anyone, go wild if you want to add more articles / guides / info. I’m totally okay with you adding your own blog posts there.

Olical22:06:37

Thinking of mapping all config into flat global values, like g:conjure_mapping_prefix, I think this is the simplest approach for users.

Olical22:06:52

No worrying about "are these intermediate dictionaries defined" if I use nested dictionaries.

👌 3
Olical22:06:17

The only downside I can think of is that there's no one place to get all config values, you have to interrogate each one.