-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: Take over all stdout's of neovim by default? #5
Comments
Glad you're enjoying the plugin! I don't think this would be possible right now as that'd require overriding the |
|
Possible solutions in Nvim: neovim/neovim#16396, neovim/neovim#16480. |
neovim/neovim#16396 is merged, we may consider add some options for it later. |
I don't think it can be used just yet, it seems the dependency on vim.ui_attach(
vim.api.nvim_create_namespace("redirect messages"),
{ ext_messages = true },
function(event, ...)
if event == "msg_show" then
local level = vim.log.levels.INFO
local kind, content = ...
if string.find(kind, "err") then
level = vim.log.levels.ERROR
end
vim.notify(content, level, { title = "Message" })
end
end
) |
I just silently (for now) released a new plugin that does this and a lot more. See https://github.com/folke/noice.nvim Feel free to test it out and give some feedback :) |
@rcarriga during blocking events, we sometimes need to render the messages without any delays. When that's the case, I use a separate notify instance with I'm currently patching
Would be good to have this fixed within Notify itself, but I'm not sure what you think a proper fix would be? |
Looks very cool, I'll have a go over the weekend! Sorry if it's obvious but why do messages need to be rendered immediately during blocking events? |
for example when rendering the cmdline. But also in situations where a plugin echos a message and then waits for input. Or uses In all those cases, we need to render what's still in the Noice message queue and do Lots of cases basically :) |
To clarify, just do something like: vim.notify("Enter a character?")
vim.fn.getchar() You won't see the message till after you entered a key. In this case, you want the initial message to be displayed instantly and prior to the blocking input. Noice takes care of these kinds of situations automatically. |
Ah thanks for explaining that makes complete sense! I think your solution is pretty much the right way to do it, I've added a forced render on creation and also the redraw. Also cool to see the instances being used 😁 |
Closing this as there is too much complexity involved for this plugin and noice.nvim handles it well |
I really like this plugin, and I don't like vim's default outputline(i.e. at the bottom).
So is there a way that we can take over all stdouts?
The text was updated successfully, but these errors were encountered: