Expand `float_opts` with user's options
Hi there,
at the moment in order to change border configuration user has to provide all of the other required keys in table returned from float_opts. It would be better user experience if returned table got merged with default one so only keys that user wants changing would have to be supplied. At the moment users might want to keep an eye on internal implementation and maintain its copy within their configurations.
Thanks for great plugin!
@gegoune Yes, maybe a better approach is to support either a table of a function as the user's setting, and in the case of a table it gets merged with the default one. What do you think? Would you like to implement this?
I am not a programmer and only know lua to the extends of nvim configuration, but perhaps with some guidance I could give it a go. :)
If you want to you could try to move the current float_opts function into a module-level function such that it can be imported separately and change this line to do something like:
local extend_conf = function(name, opts)
local config = require('femaco.config')
return vim.tbl_extend(config[name](opts), config.settings[name](opts))
end
...prepare_buffer(extend_conf('float_opts', {range=range, ...}))
Just a suggestion and if you feel like trying out to implement it :)
Thanks for the pointers, will have a go at it later today.