Don't alter GeanyEditor internal state in editor_create_widget()

When editor_create_widget() is used on an editor with already existing
widget, don't reset the internal indentation settings of that editor.
This commit is contained in:
Colomban Wendling 2014-10-11 14:52:14 +02:00
parent 41c66e0eb0
commit eb7fd066b1

View File

@ -4823,6 +4823,8 @@ ScintillaObject *editor_create_widget(GeanyEditor *editor)
{ {
const GeanyIndentPrefs *iprefs = get_default_indent_prefs(); const GeanyIndentPrefs *iprefs = get_default_indent_prefs();
ScintillaObject *old, *sci; ScintillaObject *old, *sci;
GeanyIndentType old_indent_type = editor->indent_type;
gint old_indent_width = editor->indent_width;
/* temporarily change editor to use the new sci widget */ /* temporarily change editor to use the new sci widget */
old = editor->sci; old = editor->sci;
@ -4835,7 +4837,11 @@ ScintillaObject *editor_create_widget(GeanyEditor *editor)
/* if editor already had a widget, restore it */ /* if editor already had a widget, restore it */
if (old) if (old)
{
editor->indent_type = old_indent_type;
editor->indent_width = old_indent_width;
editor->sci = old; editor->sci = old;
}
return sci; return sci;
} }