Package: diffoscope
Version: 56
Severity: minor
Tags: upstream patch
Dear Maintainer,
The following provides Vim folding for diffoscope text output:
[[[
function! Diffoscope_txt_foldexpr(lnum)
let offset = stridx(getline(a:lnum), '├── ')
if offset >= 0
return '>' . (1+offset/6)
else
return '='
endif
endfun
set foldmethod=expr foldexpr=Diffoscope_txt_foldexpr(v:lnum)
]]]
Please consider adding this to the documentation. A better would be to
wrap this as a proper ftplugin or plugin, if somebody steps up to figure
out and write the needed glue code.
Cheers,
Daniel