[gnome-builder/wip/libide-merge] use potentially stashed cursor position
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide-merge] use potentially stashed cursor position
- Date: Thu, 19 Mar 2015 20:26:57 +0000 (UTC)
commit f62bf0baa3117e4a4532de9a5ce0908fef9e442f
Author: Christian Hergert <christian hergert me>
Date: Thu Mar 19 13:26:27 2015 -0700
use potentially stashed cursor position
this fixes multiple views so they show the right position
src/editor/gb-editor-frame.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/editor/gb-editor-frame.c b/src/editor/gb-editor-frame.c
index 5b7515a..940b7ce 100644
--- a/src/editor/gb-editor-frame.c
+++ b/src/editor/gb-editor-frame.c
@@ -45,21 +45,17 @@ on_cursor_moved (GbEditorDocument *document,
const GtkTextIter *location,
GbEditorFrame *self)
{
- GtkSourceView *source_view;
- gchar *text;
- guint ln;
- guint col;
+ g_autofree gchar *text = NULL;
+ guint ln = 0;
+ guint col = 0;
g_return_if_fail (GB_IS_EDITOR_FRAME (self));
g_return_if_fail (GB_IS_EDITOR_DOCUMENT (document));
- source_view = GTK_SOURCE_VIEW (self->source_view);
+ ide_source_view_get_visual_position (self->source_view, &ln, &col);
- ln = gtk_text_iter_get_line (location);
- col = gtk_source_view_get_visual_column (source_view, location);
text = g_strdup_printf (_("Line %u, Column %u"), ln + 1, col + 1);
nautilus_floating_bar_set_primary_label (self->floating_bar, text);
- g_free (text);
//gb_editor_frame_update_search_position_label (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]