Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: damian_reloaded on May 10, 2020, 06:59:33 pm
-
I'm experiencing this bugs since a few nightly builds ago. I searched the forums to see if it had been reported but couldn't find anything related.
Steps to reproduce the bug:
Inside the editor.
0. [starting state]
1. Type a character
2. Press enter.
3. Type another character
4. Press enter.
5. Type another character
6. Press backspace
7. Type another character.
8. Press Ctrl-Z
Result: After pressing Ctrl-Z the editor gets reverted to 0.[starting state] instead of [6.Press backspace]
OS: Windows 10
Name : Code::Blocks
Version : svn-r12072
SDK Version : 2.2.0
Scintilla Version: 3.7.5
Author : The Code::Blocks Team
E-mail : info@codeblocks.org
Website : http://www.codeblocks.org
wxWidgets Library (wxMSW port)
Version 3.1.3 (Unicode: wchar_t, debug level: 1),
compiled at Nov 1 2019 18:53:26
Runtime version of toolkit used is 10.0.
-
Which is the last night build which works correctly?
-
I downloaded 10016 and I'm experiencing the same behavior.
I'm beginning to think I started noticing this bug after I upgraded my box to Windows 10. I don't have any computer with windows 7 or 8. I had a virtual machine with windows xp but couldn't get code blocks to work on it.
I can confirm the bug also happens in another computer with Windows 10 freshly installed.
It seems to behave differently depending on the type of source file opened.
In a new "Empty File" type
1 [enter]
2 [enter]
3 [enter]
pressing Ctrl-Z once erases the 3 lines
in a cpp file:
1 [enter]
2 [enter]
3 [enter]
pressing Ctrl-Z correctly only erases one number every time it's pressed, but at some point, after typing something else it breaks and behaves like the example above, erasing everything at once.
my2c
-
Hm, I can reproduce this... It is not OS dependant.
-
I just tested 16.01 on Debian and the bug is there too... what's going on?
I've been using Code::blocks for most of the last decade and I've never noted this before... and I would have noted it because is pretty annoying.
Some basic dependency common to all versions that got bugged? Or some surreptitious firmware update?
Maybe someone traveled to the past and stepped on a butterfly. I'm scared. :/
-
My guess is that you've never noticed it for plain text files :)
-
There must be something else going on besides that example because I'm currently coding and sometimes the Undo will erase entire blocks of typed code. This I can bet my life wasn't happening a few months ago...
Do you know from the top of your head if any plugin taps with the Undo feature?
-
I don't think so. The scintilla component hasn't been updated recently, either.
-
You'll have to do a bisect on the night builds to find out where this behaviour started.
-
I think I'm going crazy.
I just opened notepad++ and it behaves the same way, example:
hello world [enter]
[enter]
testing bug [enter]
[enter]
asdf [backspace] [backspace] [backspace] [backspace]
hello
[ctrl-z] (erases the word "hello")
[ctrl-z] (restores the word "asdf")
[ctrl-z] (clears the entire editor to blank)
At this point I'm freaking out, so I open a virtual machine with Windows XP and run Wordpad:
hello world [enter]
[enter]
testing bug [enter]
[enter]
asdf [backspace] [backspace] [backspace] [backspace]
hello
[ctrl-z] (erases EVERYTHING)
Then Visual Studio behaves as I remember undo used to work (last year I've been working with visual studio mostly which might be the cause of my confusion?)
hello world [enter]
[enter]
testing bug [enter]
[enter]
asdf [backspace] [backspace] [backspace] [backspace]
hello
[ctrl-z] (erases the word "hello")
[ctrl-z] (restores character "a")
[ctrl-z] (restores character "s")
[ctrl-z] (restores character "d")
[ctrl-z] (restores character "f")
[ctrl-z] (erases word "asdf")
[ctrl-z] (erases new line)
[ctrl-z] (erases new line)
[ctrl-z] (erases phrase "testing bug")
[ctrl-z] (erases new line)
[ctrl-z] (erases new line)
[ctrl-z] (erases phrase "hello world")
Open Office Writer undo function seems to work on a character basis so ctrl-z will erase the last character
Apparently it's not an issue with Code::Blocks. Is this how Code::Blocks works for you? Maybe it's a locale or a keyboard issue? I'm bafled. :/
-
https://www.scintilla.org/ScintillaDoc.html#UndoAndRedo
Both notepad++ and Code::Blocks use the same component.
BTW: Your example behaves differently when using different highlight modes. For C++ it seems to work fine, for plain text it is broken as you describe.