[anjuta] language-support-cpp-java: bgo#633112 - Smart Brace Completion Quotation Mark Crash
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] language-support-cpp-java: bgo#633112 - Smart Brace Completion Quotation Mark Crash
- Date: Wed, 10 Nov 2010 10:26:46 +0000 (UTC)
commit e5d738c91b3d0e803e635e100209e6331562e917
Author: Johannes Schmid <jhs gnome org>
Date: Wed Nov 10 11:26:33 2010 +0100
language-support-cpp-java: bgo#633112 - Smart Brace Completion Quotation Mark Crash
plugins/language-support-cpp-java/plugin.c | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index d47a426..065a685 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -1428,6 +1428,22 @@ get_line_auto_indentation (CppJavaPlugin *plugin, IAnjutaEditor *editor,
return line_indent;
}
+static void on_editor_char_inserted_cpp (IAnjutaEditor *editor,
+ IAnjutaIterable *insert_pos,
+ gchar ch,
+ CppJavaPlugin *plugin);
+
+static void
+insert_editor_blocked (IAnjutaEditor* editor,
+ IAnjutaIterable* iter,
+ gchar* text,
+ CppJavaPlugin* plugin)
+{
+ g_signal_handlers_block_by_func (editor, on_editor_char_inserted_cpp, plugin);
+ ianjuta_editor_insert (editor, iter, text, -1, NULL);
+ g_signal_handlers_unblock_by_func (editor, on_editor_char_inserted_cpp, plugin);
+}
+
static void
on_editor_char_inserted_cpp (IAnjutaEditor *editor,
IAnjutaIterable *insert_pos,
@@ -1525,12 +1541,12 @@ on_editor_char_inserted_cpp (IAnjutaEditor *editor,
switch (ch)
{
case '[':
- ianjuta_editor_insert (editor, iter,
- "]", 1, NULL);
+ insert_editor_blocked (editor, iter,
+ "]", plugin);
break;
case '(':
- ianjuta_editor_insert (editor, iter,
- ")", 1, NULL);
+ insert_editor_blocked (editor, iter,
+ ")", plugin);
break;
default:
break;
@@ -1570,7 +1586,7 @@ on_editor_char_inserted_cpp (IAnjutaEditor *editor,
else c = g_strdup ("'");
ianjuta_document_begin_undo_action (IANJUTA_DOCUMENT (editor), NULL);
- ianjuta_editor_insert (editor, iter, c, 1, NULL);
+ insert_editor_blocked (editor, iter, c, plugin);
ianjuta_editor_goto_position (editor, iter, NULL);
ianjuta_document_end_undo_action (IANJUTA_DOCUMENT (editor), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]