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

Apply rename in one editor transaction #157

Closed
park9140 opened this issue Mar 6, 2015 · 6 comments
Closed

Apply rename in one editor transaction #157

park9140 opened this issue Mar 6, 2015 · 6 comments
Assignees
Labels

Comments

@park9140
Copy link
Contributor

park9140 commented Mar 6, 2015

Rename applies changes as individual changes and undo takes way to long. Roll undo into one transaction so that it is one undo step.

@basarat basarat added the task label Mar 6, 2015
@basarat
Copy link
Member

basarat commented Mar 6, 2015

👍 tips on how to do that? I'd be tempted to take a whack at it. I did it on our codebase during a demo and it quickly became non manageable

@park9140
Copy link
Contributor Author

park9140 commented Mar 6, 2015

@basarat, If I don't get to it first, basically wrap the application of each call to editor to do a rename in https://atom.io/docs/api/v0.186.0/TextEditor#instance-transact. Set the grouping interval to 1ms and since you are doing sync changes they should all group together. You may need to extend the grouping interval.

@basarat
Copy link
Member

basarat commented Mar 6, 2015

@basarat
Copy link
Member

basarat commented Mar 6, 2015

I'm not sure about the grouping interval code though atom/find-and-replace#108. Couldn't find it using my phone ❤️

@park9140
Copy link
Contributor Author

park9140 commented Mar 6, 2015

@basarat, I was mostly complaining about having to undo multiple changes in one file.

But no there does not appear to be a cross editor undo capability, ctrl-z just undos the current editor by design so it really would be weird if suddenly an undo reverted multiple editors. Maybe a library to track and manage undo history project wide would be useful.

@basarat
Copy link
Member

basarat commented Mar 6, 2015

find and replace doesn't use a grouping interval. Neither should we : https://github.com/atom/find-and-replace/blob/3386d13e412623bf64cc9001586db35a19364b58/lib/find-model.coffee#L59 it is optional 👍

@basarat basarat self-assigned this Mar 13, 2015
basarat added a commit that referenced this issue Mar 13, 2015
…so you can undo the entire file with one undo

closes #157
@basarat basarat closed this as completed Mar 13, 2015
@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
angelestelar5z added a commit to angelestelar5z/atom-typescript that referenced this issue Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants