From b5e390519574e5d2eacbcae67bd2e3b8368de7af Mon Sep 17 00:00:00 2001 From: Ben Woodward Date: Wed, 2 Aug 2023 11:59:22 +0100 Subject: [PATCH] fix(neogit): move check into code rather than docs (#494) --- lua/astrocommunity/git/neogit/README.md | 22 ---------------------- lua/astrocommunity/git/neogit/init.lua | 4 +++- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/lua/astrocommunity/git/neogit/README.md b/lua/astrocommunity/git/neogit/README.md index 3ab9df163..c52aa0e17 100644 --- a/lua/astrocommunity/git/neogit/README.md +++ b/lua/astrocommunity/git/neogit/README.md @@ -6,25 +6,3 @@ magit for neovim A work-in-progress Magit clone for Neovim that is geared toward the Vim philosophy. - -## Noice notification support - -Neogit configuration checks if "nvim-notify" is available, otherwise disables Neogit notifications - -When using noice, add an override to check for "noice-nvim" - -```lua -return { - "AstroNvim/astrocommunity", - { import = "astrocommunity.git.neogit" }, - { - "NeogitOrg/neogit", - dependencies = { - { "nvim-lua/plenary.nvim", "sindrets/diffview.nvim" }, - }, - opts = { - -- disable_builtin_notifications = false, - disable_builtin_notifications = utils.is_available "noice-nvim", - }, - }, -``` diff --git a/lua/astrocommunity/git/neogit/init.lua b/lua/astrocommunity/git/neogit/init.lua index 764b57b47..61fc31397 100644 --- a/lua/astrocommunity/git/neogit/init.lua +++ b/lua/astrocommunity/git/neogit/init.lua @@ -27,8 +27,10 @@ return { }, event = "User AstroGitFile", opts = function(_, opts) + local disable_builtin_notifications = utils.is_available "nvim-notify" or utils.is_available "noice.nvim" + return utils.extend_tbl(opts, { - disable_builtin_notifications = utils.is_available "nvim-notify", + disable_builtin_notifications = disable_builtin_notifications, telescope_sorter = function() if utils.is_available "telescope-fzf-native.nvim" then return require("telescope").extensions.fzf.native_fzf_sorter()