Closed tris203 closed 2 weeks ago
I am completely open to the implementation, perhaps it should overwrite the notify function completely rather than just be additional.
It depends what you would like to consider
@m4xshen did you have any thoughts on this?
Hi @tris203, sorry for the late reply.
I am completely open to the implementation, perhaps it should overwrite the notify function completely rather than just be additional.
Could you please provide an example of how precognition.nvim will use this option to achieve integration under both implementation?
It's hard to say which one is better. It would be nice to have some example code.
Thanks for the reply @m4xshen. Dont worry about the speed, we are all busy!
It's hard to say which one is better. It would be nice to have some example code.
In the current implementation you can pass something like this in setup:
{
'm4xshen/hardtime.nvim',
dependencies = { 'tris203/precognition.nvim' },
opts = {
callback = function(config, text)
require('precognition').peek()
end,
},
},
This will toggle the precognition hints every time that you get a notification from hardtime.
If we were to overwrite the function entirely, then it would be very similar, except that you would also be required to recreate the notification as well as the additional actions
Got it. I prefer to overwrite the function entirely and the default value of callback
should be util.notify
.
Have made changes and rebased @m4xshen
@tris203 Thanks for the PR! You can now use this option to integrate with precognition.nvim!
btw I'm looking forward to the inlay hint feature, is this available now?
@tris203 Thanks for the PR! You can now use this option to integrate with precognition.nvim!
btw I'm looking forward to the inlay hint feature, is this available now?
Thanks @m4xshen Yeah inlay hints are merged as of a few weeks ago!
This commit introduces a new
callback
function to the notification system. This function can be used to trigger custom events on a notification. It receives a config object and the notification text as parameters. Thecallback
function is optional and is added to theconfig
object inconfig.lua
. Thenotify
function inutil.lua
has been updated to call thecallback
function if it is provided.This would be one way to handle a request we had in https://github.com/tris203/precognition.nvim/issues/62
But open to your ideas about implementation.
Draft as this is just a talking point for now