Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

maxbrunsfeld
Copy link
Contributor

I realized that the fix added in #95 doesn't always work. When the file was saved, the undo history was still lost on reload. This fixes that.

  • Since undo stack is now preserved when reopening a window, it is more likely to get long enough to cause memory usage issues. Introduce some fixed maximum length for the undo stack.

Depends on atom/node-pathwatcher#85

@maxbrunsfeld
Copy link
Contributor Author

@kevinsawicki Could you take a look at this one, since you worked on the file loading/watching logic? It's seeming like it's ok to just always use the serialized text when deserializing the buffer, but I might be missing something.

@@ -107,7 +107,6 @@ class TextBuffer
@transactCallDepth = 0
@digestWhenLastPersisted = params?.digestWhenLastPersisted ? false
@modifiedWhenLastPersisted = params?.modifiedWhenLastPersisted ? false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @modifiedWhenLastPersisted can be removed now too, it appears unused

@kevinsawicki
Copy link
Contributor

Could you take a look at this one, since you worked on the file loading/watching logic?

This looks okay to me, I'm not 100% sure why these nuances were there previously but if the specs are green then I'm good with this. I did leave one minor comment about another piece of serialized state that could possibly be removed now as well since it is unused.

@maxbrunsfeld maxbrunsfeld force-pushed the mb-fix-undo-history-after-deserialization branch from 9501792 to f3fa3d0 Compare September 15, 2015 21:09
maxbrunsfeld pushed a commit that referenced this pull request Sep 15, 2015
…ation

Always use serialized text when deserializing
@maxbrunsfeld maxbrunsfeld merged commit 41a2fed into master Sep 15, 2015
@maxbrunsfeld maxbrunsfeld deleted the mb-fix-undo-history-after-deserialization branch September 15, 2015 21:22
@maxbrunsfeld maxbrunsfeld restored the mb-fix-undo-history-after-deserialization branch September 15, 2015 21:22
@maxbrunsfeld maxbrunsfeld deleted the mb-fix-undo-history-after-deserialization branch October 14, 2015 17:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants