fix(neogit): add patch back in
This commit is contained in:
parent
4e11858c6e
commit
9ab4cf3805
1 changed files with 12 additions and 0 deletions
|
|
@ -410,6 +410,14 @@ local function compute_highlight_groups()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local neogit_context_hl_overridden = false
|
||||||
|
|
||||||
|
-- TODO: remove once NeogitOrg/neogit#1904 merges and is released (tracked in #135)
|
||||||
|
local function override_neogit_context_highlights()
|
||||||
|
vim.api.nvim_set_hl(0, 'NeogitDiffContextHighlight', {})
|
||||||
|
neogit_context_hl_overridden = true
|
||||||
|
end
|
||||||
|
|
||||||
local function init()
|
local function init()
|
||||||
if initialized then
|
if initialized then
|
||||||
return
|
return
|
||||||
|
|
@ -633,6 +641,9 @@ local function init()
|
||||||
vim.api.nvim_create_autocmd('ColorScheme', {
|
vim.api.nvim_create_autocmd('ColorScheme', {
|
||||||
callback = function()
|
callback = function()
|
||||||
compute_highlight_groups()
|
compute_highlight_groups()
|
||||||
|
if neogit_context_hl_overridden then
|
||||||
|
override_neogit_context_highlights()
|
||||||
|
end
|
||||||
for bufnr, _ in pairs(attached_buffers) do
|
for bufnr, _ in pairs(attached_buffers) do
|
||||||
invalidate_cache(bufnr)
|
invalidate_cache(bufnr)
|
||||||
end
|
end
|
||||||
|
|
@ -759,6 +770,7 @@ function M.attach(bufnr)
|
||||||
local neogit_augroup = nil
|
local neogit_augroup = nil
|
||||||
if config.neogit and vim.bo[bufnr].filetype:match('^Neogit') then
|
if config.neogit and vim.bo[bufnr].filetype:match('^Neogit') then
|
||||||
vim.b[bufnr].neogit_disable_hunk_highlight = true
|
vim.b[bufnr].neogit_disable_hunk_highlight = true
|
||||||
|
override_neogit_context_highlights()
|
||||||
neogit_augroup = vim.api.nvim_create_augroup('diffs_neogit_' .. bufnr, { clear = true })
|
neogit_augroup = vim.api.nvim_create_augroup('diffs_neogit_' .. bufnr, { clear = true })
|
||||||
vim.api.nvim_create_autocmd('User', {
|
vim.api.nvim_create_autocmd('User', {
|
||||||
pattern = 'NeogitDiffLoaded',
|
pattern = 'NeogitDiffLoaded',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue