Closed shaunsingh closed 2 years ago
That is weird, I just did an small test and underline is included on the end result.
See the following screenshot:
Here is the code I used:
(do
(macro highlight! [name attributes colors]
(fn ->str [x] (tostring x))
(let [name (->str name)
colors (collect [_ v (ipairs attributes) :into colors] (->str v) true)]
`(vim.api.nvim_set_hl 0 ,name ,colors)))
(macrodebug (highlight! MatchParen [:underline] {:bg "#262626"})))
Here is the output:
(vim.api.nvim_set_hl 0 :MatchParen {:bg "#262626" :underline true})
The code of the macro is basically the same, I just removed the assertions and included the ->str
function inside the macro (this is because macros can't access locals outside of themselves).
It seems that Conjure shows a different output from the one Hotpot produces.
See the following screenshot (at the top the original module and at the bottom the compilation result):
Wierdly, if I run the module using :Fnl
and macrodebug
the macro expands properly.
If I include macrodebug
on the module and it's executed on startup the underline property is included.
When printing inside the macro the expected values are displayed:
I probably is an issue with Hotpot so a new issue should be opened, this is very weird.
I opened the following Issue on Hotpot: https://github.com/rktjmp/hotpot.nvim/issues/57
After a test this seems to be an issue with Fennel itself, so I will open a new issue on the Fennel repository.
Here is the issue on the Fennel repository: https://github.com/bakpakin/Fennel/issues/425
Thank you!
FYI, https://github.com/bakpakin/Fennel/issues/425 has been fixed, but you need to have the nightly version of Fennel.
Hotpot now includes a nightly
branch that uses that version of Fennel, so if you use that it should be fixed.
I will be closing this issue.
Btw, I moved my macros to datwaft/themis.nvim. I don't recommend you to use it directly as it's not made for external use, but you can fork it or use it as a reference for your configuration.
Thank you. I've changed the branch to nightly
and have copied over your new macros with some modifications (and proper credits, of course). I hope you don't mind, and thank you once again for the help!
Hello, thank you once again for the excellent set of macros
I was recently trying out the
highlight!
macro, with the following code:Which compiles to the following via hotpot:
As you can see, bold/underline don't get passed to
nvim_set_hl
. Am I using it incorrectly by any chance?