Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
Qt Creator 2.4.1, Qt Creator 2.5.0, Qt Creator 2.5.2, Qt Creator 2.6.0-rc, Qt Creator 14.0.0
-
None
Description
When I save file with some code folded, unexpected blocks of code could pop out suddenly.
To reproduce this bug in Qt Creator
- open file c.c
int main() { // Qt Creator code folding bug return 0; }
- add few empty lines just after comment by pressing Return key
int main() { // Qt Creator code folding bug return 0; }
- fold main() function by clicking on minus sign
- save file
Expected: nothing visual should happen
Unexpected: after saving file return 0; pops out without any reason
Some details.
It's probably somehow related to Editor's behavior on dealing with empty lines. Editor tries to remove any redundant whitespace characters on each empty line right before saving document. If I turn this feature off then everything works as expected.
You can untick this feature here:
Tools - Options - Text Editor - Behavior - Cleanups Upon Saving - [ ] Clean whitespace
Attachments
Issue Links
- relates to
-
QTCREATORBUG-7852 Refactoring of Code Folding
- Reported
- replaces
-
QTCREATORBUG-8121 Random code unfolding on current file if ctrl+s (save) is pressed
- Closed