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

Make checkpoints before hard wrapping #16

Open
djpaterson opened this issue Jan 25, 2018 · 0 comments
Open

Make checkpoints before hard wrapping #16

djpaterson opened this issue Jan 25, 2018 · 0 comments

Comments

@djpaterson
Copy link
Contributor

There is an issue with how Wraptor interacts with Atom's history mechanism which means that if I type a block of text that is then hard wrapped, the undo often undoes the hard wrapping rather than the actual typing (which then causes a loop of undo/redo the hard wrap)

STEPS TO REPRODUCE:

  1. Create a new text file
  2. Exceed the preferredLineLength variable (for testing I used "this is a long sentence that will need to hard wrap due to exceeding 80 in the current workspace"
  3. Wait for hard wrap
  4. Undo

Expected Outcome
The typing will be undone

Actual Outcome
The hard wrap will be undone with the text remaining - if I don't immediately press undo again, the hard wrap takes effect again, meaning no undo actually happens.

I don't know what the best way to go about solving this problem is - I'm not really convinced as to whether hard wrap should contribute to the history of the editor, but that is quite possibly an internal mechanism. I think either wraptor should recognise if a wrap has been undone and leave the line as it is (perhaps someone wants a line not wrapped) or it should make use of the createCheckpoint()/revertToCheckpoint() methods of the editor to be able to undo the typing instead of just the wrapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant