diff --git a/doc/fugitive-ts.nvim.txt b/doc/fugitive-ts.nvim.txt index 7ade1bc..1bfd9e4 100644 --- a/doc/fugitive-ts.nvim.txt +++ b/doc/fugitive-ts.nvim.txt @@ -62,6 +62,10 @@ CONFIGURATION *fugitive-ts-config* Vim syntax highlighting options (experimental). See |fugitive-ts.VimConfig| for fields. + {diffsplit} (table, default: see below) + Diffsplit highlighting options. + See |fugitive-ts.DiffsplitConfig| for fields. + {highlights} (table, default: see below) Controls which highlight features are enabled. See |fugitive-ts.Highlights| for fields. @@ -90,6 +94,15 @@ CONFIGURATION *fugitive-ts-config* this many lines. Lower than the treesitter default due to the per-character cost of |synID()|. + *fugitive-ts.DiffsplitConfig* + Diffsplit config fields: ~ + {enabled} (boolean, default: true) + Override diff highlight foreground colors in + |:Gdiffsplit| and |:Gvdiffsplit| windows so + treesitter syntax is visible through the diff + backgrounds. Uses window-local 'winhighlight' + and only applies to fugitive-owned buffers. + *fugitive-ts.Highlights* Highlights table fields: ~ {background} (boolean, default: true) diff --git a/lua/fugitive-ts/init.lua b/lua/fugitive-ts/init.lua index 0f42e7e..f76085e 100644 --- a/lua/fugitive-ts/init.lua +++ b/lua/fugitive-ts/init.lua @@ -352,6 +352,15 @@ function M.setup(opts) end end, }) + + vim.api.nvim_create_autocmd('WinClosed', { + callback = function(args) + local win = tonumber(args.match) + if win and diff_windows[win] then + diff_windows[win] = nil + end + end, + }) end return M