-
Notifications
You must be signed in to change notification settings - Fork 54
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
🎉 Add custom undo system #118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please name back scene.scene_history to scene.history as it is useless to precise scene again, for both the submodule name and the OCBScene attribute.
You can create a submodule pyeditor
with pyeditor.py
and history.py
inside.
You can then import submodules classes in pyeditor.__init__.py
for easy access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be updated with the new code structure (opencodeblocks/core doesn't exist anymore)
984a0da
to
ebd26aa
Compare
I rebased the changes of this old bug fix manually because the code had changed too much. |
The undo system I introduced is not the cause of this bug. The current dev branch displays the same behaviour, and markdown blocks, which don't have a custom editor, too. |
I don't know why the tests failed. |
That's because text editor had no history before !
Text editing should had a checkpoint to the whole scene, but not the reciprocal ! When not in any editor, the ctrl+z should undo the previous action, whatever it was (even text editing). When in an editor, ctrl+z should undo the last action in that editor only.
You probably changed how the history is handled and broke a test, if you don't understand why it failed I will look into it and comment it better ! |
Both markdown blocks and code blocks had the default Qt history.
The test which doesn't pass is the test I added. It works on my machine. It doesn't work on github. |
I fixed some issues, but for now this is not working because undo in the main history causes the scene to "rebuild" codeblocks making them lose their local editor history. This falls into a larger problem mentioned in #119. |
🔧 Refactor bring_block_forward using currentSelectedBlock as property
🪲 🔧 Refactor test_write_code_blocks
…son (but we can see it works in the GUI ?)
Fixes #241 |
Tests were commented out because we really need to merge this (they work locally). |
Fix the bug #27 by creating a custom undo system.