User forums > Using Code::Blocks

bug in "Settings->Editor->End-of-line options"

<< < (2/2)

Jenna:
Should be (hopefully) be fixed in trunk (svn r6342).

I will explain the cause for it later (no time at the moment).

EDIT:
The error was caused by wxWidgets (or a misuse of checking or unchecking a wxMenuItem in a radiogroup).
The editorconfigurationdialog sets the eol-mode of the file to the new value.
If we reach MainFrame::OnEditMenuUpdateUI in main.cpp we set the appropriate menuitems accordingly.
The items are radio-items (only one can be checked) grouped in a submenu.
The former code tried to check and uncheck all items directly, but unchecking a checked radio-item causes a wxEVT_COMMAND_MENU_SELECTED and triggers MainFrame::OnEditEOLMode, which forces the change of the endofline-characters for the whole file.
We only need to check the MenuItem we want to have selected and leave the other untouched, because wxWidgets unchecks them itself.
By the way checking the item with the Check()-function does not trigger the event.

There is still a little inconsistency, if we check a menu-item via the Check()-function, we "only" change the default EOL-mode of the file and therfore all later typed EOL'S), but if we check it via the menu, we convert all EOL-characters in the file, even if "Ensure consisten EOLs" is not set.

Navigation

[0] Message Index

[*] Previous page

Go to full version