Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Undo #17

Open
timsofteng opened this issue Jun 16, 2021 · 15 comments
Open

Adding Undo #17

timsofteng opened this issue Jun 16, 2021 · 15 comments
Labels
enhancement New feature or request pinned

Comments

@timsofteng
Copy link

Hello. I see in readme that undo is not support after saving.
Is it any way to implement it?
I find this plugin good which is different of course but it supports undo:
https://github.com/dyng/ctrlsf.vim

maybe it can help

@windwp
Copy link
Collaborator

windwp commented Jun 16, 2021

I use a regex replace from sed to replace text that not belong to vim.
Of course it has a way to do that but it's too complicated now.. PR is welcome.

@windwp windwp added the enhancement New feature or request label Jun 16, 2021
@stale
Copy link

stale bot commented Sep 25, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 25, 2021
@timsofteng
Copy link
Author

Please don't close it.

@stale stale bot removed the wontfix This will not be worked on label Sep 25, 2021
@stale
Copy link

stale bot commented Nov 24, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 24, 2021
@timsofteng
Copy link
Author

Please don't close it.

@stale stale bot removed the wontfix This will not be worked on label Nov 24, 2021
@stale
Copy link

stale bot commented Jan 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jan 23, 2022
@timsofteng
Copy link
Author

!

@stale stale bot removed the wontfix This will not be worked on label Jan 24, 2022
@binhtran432k
Copy link

@windwp, How about always create backup option in setup? Then user can choose to delete or restore it.

@windwp windwp added the pinned label Mar 19, 2022
@EpsilonKu
Copy link
Member

seddoesn't have undo command. However we can back-up file before changes. Idk, how it will be costly for performance

@GrimalDev
Copy link

Hello, does anyone see a problem in adding a function to invert the search at least instead of an undo system ( undo system that would theoretically be too performance costly). So a user could get back to a previous search and replace (That would need to implement a telescope on a search history) and just invert the search and replace to theoretically "put it back" the way it was?

@EpsilonKu
Copy link
Member

Honestly my brain.exe can't do that complex task tho. I was nearly debunked when doing #210 . Sadly windwp is busy and only do some fixes.

@Kurren123
Copy link

It’s unfortunate as the lack of undo is the only thing preventing me from using this otherwise great plugin. How about an option to automatically git commit/stash before replacing?

@GrimalDev
Copy link

It’s unfortunate as the lack of undo is the only thing preventing me from using this otherwise great plugin. How about an option to automatically git commit/stash before replacing?

I'm not sure but this could generate git conflicts right ? (Which wouldn't be all that bad, but still conflicts)

@pbower
Copy link

pbower commented Aug 9, 2024

Hi, I’d like to suggest the following solution to this important requirement:

  1. On replace, before conducting the replacement copy the impacted files to a temporary directory within the users nvim space, along with a mapping hash or something of this nature
  2. Git the directory (invisible to the user)
  3. After the replace, make it a modified version with a commit e.g. v1,v2 for the next replace etc.
  4. When terminating the program, delete the folder (but make this behaviour configurable).
  5. Make this whole tree mapped to the users project path, so that if one doesn’t delete the folder, the undo history remains next time in the plugin.
  6. Offer the option to turn off the undo redo, and also configure the path (for enterprise security reasons).
  7. Hide all the git stuff from the user so it’s a seamless experience.

@pbower
Copy link

pbower commented Aug 9, 2024

Although I didn’t specify it above, I hope it’s clear that stepping forward and backward through the search and replace undo tree means walking backwards and forwards through through this isolated git commits, and copying those files back into the respective user directory locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

7 participants