diff --git a/plugins/scintilla/scintilla/gtk/ScintillaGTK.cxx b/plugins/scintilla/scintilla/gtk/ScintillaGTK.cxx
index be007e7..85e3c4d 100644
--- a/plugins/scintilla/scintilla/gtk/ScintillaGTK.cxx
+++ b/plugins/scintilla/scintilla/gtk/ScintillaGTK.cxx
@@ -354,6 +354,11 @@ static ScintillaGTK *ScintillaFromWidget(GtkWidget *widget) {
 	return reinterpret_cast<ScintillaGTK *>(scio->pscin);
 }
 
+extern "C" void *ScintillaGTKFromWidget(GtkWidget *widget) {
+	ScintillaObject *scio = reinterpret_cast<ScintillaObject *>(widget);
+	return reinterpret_cast<ScintillaGTK *>(scio->pscin);
+}
+
 ScintillaGTK::ScintillaGTK(_ScintillaObject *sci_) :
 		adjustmentv(0), adjustmenth(0),
 		scrollBarWidth(30), scrollBarHeight(30),
diff --git a/plugins/scintilla/scintilla/src/Document.cxx b/plugins/scintilla/scintilla/src/Document.cxx
index 244e96e..cfa712c 100644
--- a/plugins/scintilla/scintilla/src/Document.cxx
+++ b/plugins/scintilla/scintilla/src/Document.cxx
@@ -101,6 +101,7 @@ Document::Document() {
 	enteredStyling = 0;
 	enteredReadOnlyCount = 0;
 	tabInChars = 8;
+	fprintf(stdout,"\t%p tabInChars %d\n", this, tabInChars);
 	indentInChars = 0;
 	actualIndentInChars = 8;
 	useTabs = true;
diff --git a/plugins/scintilla/scintilla/src/Editor.cxx b/plugins/scintilla/scintilla/src/Editor.cxx
index d72ff30..e8f9a40 100644
--- a/plugins/scintilla/scintilla/src/Editor.cxx
+++ b/plugins/scintilla/scintilla/src/Editor.cxx
@@ -5372,6 +5372,7 @@ int Editor::KeyCommand(unsigned int iMessage) {
 		EnsureCaretVisible();
 		break;
 	case SCI_TAB:
+		fprintf(stdout, "TAB %p document %p pdoc->TabInChars %d\n", this, pdoc, pdoc->tabInChars);
 		Indent(true);
 		if (caretSticky == SC_CARETSTICKY_OFF) {
 			SetLastXChosen();
@@ -7750,6 +7751,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
 
 	case SCI_SETTABWIDTH:
 		if (wParam > 0) {
+			fprintf(stdout, "\t%p document %p pdoc->TabInChars %d->%d\n", this, pdoc, pdoc->tabInChars, wParam);
 			pdoc->tabInChars = wParam;
 			if (pdoc->indentInChars == 0)
 				pdoc->actualIndentInChars = pdoc->tabInChars;
diff --git a/plugins/scintilla/text_editor.c b/plugins/scintilla/text_editor.c
index 0717520..f95f8bd 100644
--- a/plugins/scintilla/text_editor.c
+++ b/plugins/scintilla/text_editor.c
@@ -2414,9 +2414,12 @@ itext_editor_get_tab_size (IAnjutaEditor *editor, GError **e)
 								   SCI_GETTABWIDTH, 0, 0);
 }
 
+void *ScintillaGTKFromWidget(GtkWidget *widget);
+
 static void
 itext_editor_set_tab_size (IAnjutaEditor *editor, gint tabsize, GError **e)
 {
+	g_message("itext_editor_set_tab_size %p scintilla %p %p tabsize %d", editor, TEXT_EDITOR (editor)->scintilla, ScintillaGTKFromWidget (GTK_WIDGET (TEXT_EDITOR (editor)->scintilla)), tabsize);
 	scintilla_send_message (SCINTILLA (TEXT_EDITOR (editor)->scintilla),
 							SCI_SETTABWIDTH, tabsize, 0);
 }
diff --git a/plugins/scintilla/text_editor_prefs.c b/plugins/scintilla/text_editor_prefs.c
index b5d4a89..5db4adf 100644
--- a/plugins/scintilla/text_editor_prefs.c
+++ b/plugins/scintilla/text_editor_prefs.c
@@ -130,6 +130,8 @@ on_notify_zoom_factor(GSettings* settings,
 	g_signal_emit_by_name(G_OBJECT (te), "update_ui");
 }
 
+void *ScintillaGTKFromWidget(GtkWidget *widget);
+
 static void
 on_notify_tab_size (GSettings* settings,
                     const gchar* key,
@@ -140,9 +142,11 @@ on_notify_tab_size (GSettings* settings,
 
 	te = TEXT_EDITOR (user_data);
 	tab_size = set_n_get_prop_int (settings, key);
+	g_message("on_notify_tab_size %p scintilla %p %p tabsize %d", te, TEXT_EDITOR (te)->scintilla, ScintillaGTKFromWidget (GTK_WIDGET (TEXT_EDITOR (te)->scintilla)), tab_size);
 	text_editor_command (te, ANE_SETTABSIZE, tab_size, 0);
 }
 
+
 static void
 on_notify_use_tab_for_indentation(GSettings* settings,
                                   const gchar* key,
