Skip to content

fix(#1697): remove notify plugin auto-detection #2135

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lua/nvim-tree/notify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ local modes = {
}

do
local has_notify, notify_plugin = pcall(require, "notify")

local dispatch = function(level, msg)
if level < config.threshold then
return
end

vim.schedule(function()
if has_notify and notify_plugin then
notify_plugin(msg, level, { title = "NvimTree" })
else
vim.notify(string.format("[NvimTree] %s", vim.inspect(msg)), level)
end
vim.notify(msg, level, { title = "NvimTree" })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is obviously one downside of that meaning that by default opt table is unused so users won't know where that notification comes from unless they customize their vim.notify to prepend the title like it was done before.

Now, I am quite new in the vim ecosystem so it is hard for me to make a call whether that is ok, but as far as I know passing title within the opt table is kind of convention already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I know passing title within the opt table is kind of convention already.

It seems to be used by a few. We could safely add more info later, if a new consumer arrives.

end)
end

Expand Down