feat: add committia.vim integration (#166)
## Problem committia.vim's diff pane (`ft=git`, buffer name `__committia_diff__`) is rejected by the `ft=git` guard in the `FileType` callback, preventing diffs.nvim from highlighting it. ## Solution Add a `committia` config toggle following the same pattern as `neogit`/`gitsigns`. When enabled, the `ft=git` guard also allows committia's `__committia_diff__` buffer through. Closes #161
This commit is contained in:
parent
d06144450c
commit
dc6fd7a387
2 changed files with 21 additions and 1 deletions
|
|
@ -23,7 +23,10 @@ vim.api.nvim_create_autocmd('FileType', {
|
|||
callback = function(args)
|
||||
local diffs = require('diffs')
|
||||
if args.match == 'git' then
|
||||
if not diffs.get_fugitive_config() or not diffs.is_fugitive_buffer(args.buf) then
|
||||
local is_fugitive = diffs.get_fugitive_config() and diffs.is_fugitive_buffer(args.buf)
|
||||
local is_committia = diffs.get_committia_config()
|
||||
and vim.api.nvim_buf_get_name(args.buf):match('__committia_diff__$')
|
||||
if not is_fugitive and not is_committia then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue