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

Load new buffer, then undo, then push changes => lose buffer's|parent's content #10

Open
JeffreyBenjaminBrown opened this issue Aug 23, 2016 · 1 comment

Comments

@JeffreyBenjaminBrown
Copy link
Member

This is not a bug, but it is a danger. It arises because (I assume) the undo stack for a buffer starts counting changes before the buffer has initially loaded its contents.

@joshsh
Copy link
Member

joshsh commented Aug 23, 2016

If I understand the issue, it definitely walks the line between a bug and a feature. I actually find this behavior pretty useful in one specific context: I am in a height-1 view and absent-mindedly add a new child to one of the atoms in the list, which is not expanded. I push, and my new child goes away. I tend to make this mistake only when none of the visible atoms has children, so rather than undo-ing in the buffer, copying the child, increasing the height, and then pasting the child in, I just increase the height, then undo and push. It saves some time, but it's OK if this goes away at some point, perhaps by avoiding conflicts by attaching a version number or "last changed" timestamp to the buffer.

Let me know if that's not what you meant. Good luck on your interviews.

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

2 participants