[anjuta-extras] sci: Change ianjuta_editor_insert to work as GtkSourceView
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta-extras] sci: Change ianjuta_editor_insert to work as GtkSourceView
- Date: Sun, 10 Jan 2010 09:29:40 +0000 (UTC)
commit e3960da4c9524644d73549b26841897031d37496
Author: Sébastien Granjoux <seb sfo free fr>
Date: Sun Jan 10 10:28:34 2010 +0100
sci: Change ianjuta_editor_insert to work as GtkSourceView
plugins/scintilla/text_editor.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plugins/scintilla/text_editor.c b/plugins/scintilla/text_editor.c
index af6c0af..5fb68eb 100644
--- a/plugins/scintilla/text_editor.c
+++ b/plugins/scintilla/text_editor.c
@@ -2441,15 +2441,22 @@ itext_editor_insert (IAnjutaEditor *editor, IAnjutaIterable *position,
const gchar *txt, gint length, GError **e)
{
gchar *text_to_insert;
+ int pos;
+
+ /* Use replace to move the cursor at the end of the insert text like
+ * GtkSourceView */
+ pos = text_editor_cell_get_position (TEXT_EDITOR_CELL (position));
+
+ scintilla_send_message (SCINTILLA (TEXT_EDITOR (editor)->scintilla),
+ SCI_SETSEL, pos, pos);
+
if (length >= 0)
text_to_insert = g_strndup (txt, length);
else
text_to_insert = g_strdup (txt);
- aneditor_command (TEXT_EDITOR(editor)->editor_id, ANE_INSERTTEXT,
- text_editor_cell_get_position
- (TEXT_EDITOR_CELL (position)),
- (long)text_to_insert);
+ text_editor_replace_selection (TEXT_EDITOR (editor), text_to_insert);
+
g_free (text_to_insert);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]