hunk.nvim icon indicating copy to clipboard operation
hunk.nvim copied to clipboard

Undo

Open expipiplus1 opened this issue 1 year ago • 4 comments

Thanks for this excellent tool,

It would be very handy to be able to undo changes, adding or removing hunks.

I have no idea if this is architected in a way which makes this trivial or difficult!

expipiplus1 avatar Sep 19 '24 07:09 expipiplus1

Assuming you are using jj this behaviour is actually built-in via jj undo or jj op undo - see https://martinvonz.github.io/jj/latest/cli-reference/#jj-operation-undo.

julienvincent avatar Sep 19 '24 11:09 julienvincent

I'm going to close this one out but feel free to let me know if this isn't what you were looking for or what you meant!

julienvincent avatar Sep 19 '24 20:09 julienvincent

Ah sorry no, I meant:

  • I'm using this plugin adding lines from a hunk
  • I accidentally add the whole hunk
  • I can't go back to the previous state of a partially added hunk

It would be nice to take advantage of muscle memory for u to reveres the previous a or A operation.

It's not a huge deal obviously but seeing as the buffer's noneditable then u is just sitting there waiting to be used :)

expipiplus1 avatar Sep 20 '24 01:09 expipiplus1

Hmm ok I see. I'm not sure if this is something I'm interested in working on right now but I'll leave this open and maybe I come back to it :)

julienvincent avatar Sep 20 '24 09:09 julienvincent