simnalamburt / vim-mundo

:christmas_tree: Vim undo tree visualizer
https://simnalamburt.github.io/vim-mundo
GNU General Public License v2.0
792 stars 28 forks source link

Show history for selected lines #58

Open fuine opened 7 years ago

fuine commented 7 years ago

I don't know if it's even possible, but I would love to see some functionality that would allow me to see a tree for selected line(s). In your opinion, how hard would it be to implement this feature? I'd gladly help.

dsummersl commented 7 years ago

Great question - sort of like a git blame? Would this be as simple as supporting visual selections (filter out all undos from mundo that have anything to do with the current selection)?

fuine commented 7 years ago

Yes, that's how I primarily imagined it. A lot of the times I find myself trying to see how the specific block of code has changed over the time and currently I just end up moving down the tree, looking for the changes that contain any lines from said block.

dsummersl commented 7 years ago

I don't this would be too hard:

I feel like parsing the unified diff output would be the easiest way to do these two things, but it might not be the most efficient.

dsummersl commented 7 years ago

@fuine unless you wanna take a crack at it, I'll give it a shot this week.

fuine commented 7 years ago

@dsummersl I could take on this issue, but not before the upcoming weekend. If you have a spare time however you could start hacking on that and I could help you. I'm not sure if that works for you but I'm pretty flexible in that regard

dsummersl commented 7 years ago

@fuine 👍 sounds good - I'll see what I can get done, you can take over or help code review. (or vice versa, if I completely drop the ball this week!)

dsummersl commented 7 years ago

Didn't get as much time as I wanted into this over the weekend, but I got a little. Wrote some more unit tests for graphlog, figured out where I think the changes could happen. I'll push up a branch when I get a little further along.

fuine commented 7 years ago

I'm sorry, looks like we have similar issues with time. If you have something written already please consider creating a WIP PR, as I might join in and hopefully help you.