GitGutterDiffOrig filetype/syntax-highlighting
ds2606 opened this issue · 4 comments
What is the latest commit SHA in your installed vim-gitgutter?
2f35907
What vim/nvim version are you on?
8.2
When GitGutterDiffOrig
opens a diff in a scratch-buffer split, the filetype is unset, so no syntax highlighting is shown. GitGutter should automatically set the scratch-buffer filetype to the same as the original buffer so that syntax highlighting is shown.
Hopefully this should be an easy win?
In general I like to stay consistent with Vim's behaviour, and Vim's :DiffOrig
command does not set the filetype.
However I think it's a reasonable thing to do.
Thanks for the suggestion.
Cool I understand, for now I have my :GitGutterDiffOrig
mapped to
function! GitGutterDiffWithSyntax()
let l:ft_syntax = &ft
call GitGutterDiffOrigToggle()
+windo let &ft = l:ft_syntax
wincmd p
endfunction
Making use of the +
range I learned from you in #834! thanks :-)
Oh I misunderstood and thought you weren't implementing it - great, thank you!