Skip to content

Conversation

@dgalaktionov
Copy link

I have noticed that, under the current implementation, the undo stack gets appended a copy of the whole text at every new input, which results on unacceptable memory waste for my intended application, in which I plan to edit potentially large (up to 1MB) texts, and will handle undo/redo my own way.

My change simply consists in adding a enable_undo_redo parameter on the instantiation on Buffer and PromptSession (since it always creates its own internal buffer), and using it as a flag to prevent the stacks from being populated in Buffer.undo, Buffer.redo and Buffer.save_to_undo_stack.

PromptSession was also accordingly modified in order to pass the parameter to the internal buffer it creates.
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

Successfully merging this pull request may close these issues.

1 participant