feat(gitsigns): highlight blame popup with treesitter and intra-line diffs
Problem: gitsigns blame popups show flat `GitSignsAddPreview`/ `GitSignsDeletePreview` highlights with no treesitter syntax or character-level intra-line diffs. Solution: add `lua/diffs/gitsigns.lua` which patches `Popup.create` and `Popup.update` to intercept blame popups, parse hunk sections, clear gitsigns' own highlights, and apply `highlight_hunk` with manual `@diff.plus`/`@diff.minus` prefix extmarks. Wired in `plugin/diffs.lua` with `User GitAttach` lazy-load retry.
This commit is contained in:
parent
c64ca827f3
commit
09a0418942
3 changed files with 432 additions and 0 deletions
|
|
@ -5,6 +5,19 @@ vim.g.loaded_diffs = 1
|
|||
|
||||
require('diffs.commands').setup()
|
||||
|
||||
local gs_cfg = (vim.g.diffs or {}).gitsigns
|
||||
if gs_cfg == true or type(gs_cfg) == 'table' then
|
||||
if not require('diffs.gitsigns').setup() then
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'GitAttach',
|
||||
once = true,
|
||||
callback = function()
|
||||
require('diffs.gitsigns').setup()
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = require('diffs').compute_filetypes(vim.g.diffs or {}),
|
||||
callback = function(args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue