Why? Because I am having a crack at recreating some git porcelain for kak. I know that I could “just shell out to tig” or some other tool, but if you’ve used fugitive or magit seriously there are massive gains to be made in being able to interactively edit patches with your favourite to layer up changes. I have written some dumb code that knows how to take a patch apply it and generate a side by side diff with highlighting. Nice. I can keep cursors in sync with hooks. I can obviously through blunt force trauma keep selecting buffers and rebuilding the diff view but that is offensive. It seems like perhaps there is a clever scheme to keep last and current selections in a register and on keypresses check those against saved state, but it feels pretty fragile. The editor knows what edits it’s applying and it would be cool if there was a way to hook that. I am sure there would be other applications beyond what I am thinking of. Basically I’d just like a set of ranges passed to me, before and after s.t. that I could efficiently update the other pane of the view.
Of course if there is a cool way to do this without editor support I am all ears.