How to make gitsigns preview_hunk_inline highlights override render-markdown highlights? #525
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The inline preview from That's the case for additions, but you can actually disable decorations for removed sections. The only reason this is possible is because There are various workarounds you could build for yourself. My suggestion would be a custom user command which disables this plugin, calls vim.api.nvim_create_user_command('GitsignsInline', function()
require('render-markdown').disable()
require('gitsigns').preview_hunk_inline()
vim.api.nvim_create_autocmd({ 'CursorMoved', 'InsertEnter', 'BufLeave' }, {
buffer = vim.api.nvim_get_current_buf(),
once = true,
callback = function()
require('render-markdown').enable()
end,
})
end, {}) Could bind this to a keymap if you prefer, add a condition to only do the |
Beta Was this translation helpful? Give feedback.
The inline preview from
gitsigns
isn't exactly special. By that I meangitsigns
is doing the same thing this plugin is doing, it's addingextmarks
to decorate parts of the buffer. I would have no way of accounting forgitsigns
being active on some set of lines and removing my ownextmarks
. Basically we're doing the same thing and having awareness of each other isn't really possible.That's the case for additions, but you can actually disable decorations for removed sections. The only reason this is possible is because
gitsigns
shows removed chunks in a separate buffer inside your current buffer. You can add an override to disable this plugin based onbuflisted = false
, which will remove d…