diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-11-20 22:23:57 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-11-20 22:23:57 (GMT) |
commit | d4239799ad149f65e1e480d898ccb16756f4d518 (patch) | |
tree | 2652094bd458505edb9dbcfb7db1c1a8170ce6f1 /src/gtkext | |
parent | 7c1f85b8197cb02634d06d200f68ce65e9eca717 (diff) |
Located the caret at the right position in case of minimal widths.
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/gtkblockdisplay.c | 11 | ||||
-rw-r--r-- | src/gtkext/gtkbufferdisplay.c | 9 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/gtkext/gtkblockdisplay.c b/src/gtkext/gtkblockdisplay.c index 6aaaac6..bbba06c 100644 --- a/src/gtkext/gtkblockdisplay.c +++ b/src/gtkext/gtkblockdisplay.c @@ -261,7 +261,9 @@ static gboolean gtk_block_display_button_press(GtkWidget *widget, GdkEventButton view = gtk_buffer_display_get_view(GTK_BUFFER_DISPLAY(display)); - changed = g_buffer_view_highlight_segments(view, real_x, real_y, GTK_DISPLAY_PANEL(display)->options); + changed = g_buffer_view_highlight_segments(view, real_x, real_y, + GTK_DISPLAY_PANEL(display)->options, + >K_BUFFER_DISPLAY(display)->offsets); g_object_unref(G_OBJECT(view)); @@ -312,7 +314,8 @@ static gboolean gtk_block_display_query_tooltip(GtkWidget *widget, gint x, gint real_y = y; gtk_display_panel_compute_real_coord(panel, &real_x, &real_y); - creator = g_buffer_view_find_creator(GTK_BUFFER_DISPLAY(display)->view, real_x, real_y, panel->options); + creator = g_buffer_view_find_creator(GTK_BUFFER_DISPLAY(display)->view, real_x, real_y, + panel->options, >K_BUFFER_DISPLAY(display)->offsets); if (creator != NULL) { @@ -430,7 +433,9 @@ static bool gtk_block_display_notify_caret_relocation(GtkBlockDisplay *display, view = gtk_buffer_display_get_view(GTK_BUFFER_DISPLAY(display)); - result = g_buffer_view_highlight_segments(view, area->x, area->y, GTK_DISPLAY_PANEL(display)->options); + result = g_buffer_view_highlight_segments(view, area->x, area->y, + GTK_DISPLAY_PANEL(display)->options, + >K_BUFFER_DISPLAY(display)->offsets); g_object_unref(G_OBJECT(view)); diff --git a/src/gtkext/gtkbufferdisplay.c b/src/gtkext/gtkbufferdisplay.c index 6329668..1989b1c 100644 --- a/src/gtkext/gtkbufferdisplay.c +++ b/src/gtkext/gtkbufferdisplay.c @@ -524,7 +524,8 @@ static gboolean gtk_buffer_display_key_press(GtkWidget *widget, GdkEventKey *eve ctrl = (event->state & GDK_CONTROL_MASK); area = display->caret; - status = g_buffer_view_move_caret(display->view, ctrl, dir, panel->options, &area, &cursor); + status = g_buffer_view_move_caret(display->view, ctrl, dir, panel->options, &display->offsets, + &area, &cursor); if (status) { @@ -745,7 +746,8 @@ GObject *gtk_buffer_display_get_active_object(const GtkBufferDisplay *display) else result = g_buffer_view_find_creator(display->view, display->caret.x, display->caret.y, - GTK_DISPLAY_PANEL(display)->options); + GTK_DISPLAY_PANEL(display)->options, + &display->offsets); return result; @@ -833,7 +835,8 @@ static bool _gtk_buffer_display_move_caret_to(GtkBufferDisplay *display, gint x, panel = GTK_DISPLAY_PANEL(display); - result = g_buffer_view_compute_caret_full(display->view, x, y, panel->options, &new, &cursor); + result = g_buffer_view_compute_caret_full(display->view, x, y, panel->options, &display->offsets, + &new, &cursor); if (result) gtk_buffer_display_relocate_caret(display, &new, cursor); |