-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Undo, Redo Bug at Multi-line Text Input #715
Comments
You can fix the formatting by surrounding your code with 3 backticks `. You can also set the language for highlighting. |
thanks I changed the formating |
I cannot seem to repro. Are you running Master? |
Yes I clone it from master. |
First copy all of texts in Multi-line Text Input window ctrl-c (whole area) > ctrl-v ( at last line) > ctrl-v > ctrl -v > ctrl-z > ctrl-z > ctrl-z > ctrl-y (I know about #681 but it is not that version, I think that it remains some problems)
|
OK i got it. Sorry I was doing CTRL+V again instead of CTRL+Y. |
nope, it is good to be checked a bug. |
It's closely related to the same function as #681 which is a rarely exercised path. By default we have 999 characters worth for the various undo-buffers and when this overflow that code path tries to remove older entries. At this point I think the undo stack state is incorrect.. but I'm still confused by this code. Will investigate. By the way, I should definitively increase that number from 999 to maybe 10K, that's still a low footprint. But only when we have fixed the bug :) |
We know a deep debugging is hard for everyone. |
I am quite confused by the undo-stack system in stb_textedit.h, will probably end up asking Sean Barrett but I don't want to bother him before I obtain more information. I suspect there are a few other bugs in there. Just doing Copy, Paste, Undo, Redo, Undo, Redo, Undo, Redo... Seems to exhaust the char buffer which I don't think should happen. I think the fix for that is to add this in
But that doesn't fix the bug you are mentioning above. All of this intimately connected so I need to understand the logic behind |
Other fix in
By
Test code: B. Display state:
I am not 100% sure and need to do more testing. It may be completely wrong. |
I am applying the fix now. Looking ok but awaiting further user testing. Let me know if you stumble on anything wrong. |
I found a bug at Undo, Redo at Multi-line Text Input
After I copy (Ctrl-c) all of texts
move down new bottom line and paste (Ctrl-v) 3 time
and undo (ctrl-z) 3time and redo (ctrl-y) 1time
then it always crushed.
It is a writing access violation exception
it can be reproduced again and again.
and stopped at this line (memmove)
The text was updated successfully, but these errors were encountered: