[geany/geany] eb7fd0: Don't alter GeanyEditor internal state in editor_create_widget()

Colomban Wendling git-noreply at xxxxx
Sat Oct 11 12:53:21 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 11 Oct 2014 12:53:21 UTC
Commit:      eb7fd066b12aa505614d0f8c51a9c191d17808cc
             https://github.com/geany/geany/commit/eb7fd066b12aa505614d0f8c51a9c191d17808cc

Log Message:
-----------
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.


Modified Paths:
--------------
    src/editor.c

Modified: src/editor.c
6 lines changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -4823,6 +4823,8 @@ ScintillaObject *editor_create_widget(GeanyEditor *editor)
 {
 	const GeanyIndentPrefs *iprefs = get_default_indent_prefs();
 	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 */
 	old = editor->sci;
@@ -4835,7 +4837,11 @@ ScintillaObject *editor_create_widget(GeanyEditor *editor)
 
 	/* if editor already had a widget, restore it */
 	if (old)
+	{
+		editor->indent_type = old_indent_type;
+		editor->indent_width = old_indent_width;
 		editor->sci = old;
+	}
 	return sci;
 }
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list