[gtksourceview] view: small code simplification in move_cursor()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] view: small code simplification in move_cursor()
- Date: Thu, 25 Dec 2014 19:57:49 +0000 (UTC)
commit e87403ab9c5f91d33150c400fc110b67c38ee8a7
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Dec 25 19:34:18 2014 +0100
view: small code simplification in move_cursor()
gtksourceview/gtksourceview.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index f9550aa..237932e 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -1372,15 +1372,18 @@ move_cursor (GtkTextView *text_view,
gboolean extend_selection)
{
GtkTextBuffer *buffer = gtk_text_view_get_buffer (text_view);
+ GtkTextMark *insert = gtk_text_buffer_get_insert (buffer);
if (extend_selection)
- gtk_text_buffer_move_mark_by_name (buffer, "insert",
- new_location);
+ {
+ gtk_text_buffer_move_mark (buffer, insert, new_location);
+ }
else
+ {
gtk_text_buffer_place_cursor (buffer, new_location);
+ }
- gtk_text_view_scroll_mark_onscreen (text_view,
- gtk_text_buffer_get_insert (buffer));
+ gtk_text_view_scroll_mark_onscreen (text_view, insert);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]