[gnome-builder] libide: only progress forward if not at end of line
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: only progress forward if not at end of line
- Date: Mon, 23 Mar 2015 23:53:42 +0000 (UTC)
commit f83c62a481892b38b574aa6353dc06cbb8e7eed7
Author: Christian Hergert <christian hergert me>
Date: Wed Mar 4 13:10:22 2015 -0800
libide: only progress forward if not at end of line
Be idempotent if we are already at the end of the line.
libide/ide-source-view-movements.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libide/ide-source-view-movements.c b/libide/ide-source-view-movements.c
index 82800e5..eb9d5f6 100644
--- a/libide/ide-source-view-movements.c
+++ b/libide/ide-source-view-movements.c
@@ -213,9 +213,11 @@ ide_source_view_movements_last_char (IdeSourceView *self,
ide_source_view_movements_get_selection (self, &insert, &selection);
- gtk_text_iter_forward_to_line_end (&insert);
-
- ide_source_view_movements_select_range (self, &insert, &selection, extend_selection);
+ if (!gtk_text_iter_ends_line (&insert))
+ {
+ gtk_text_iter_forward_to_line_end (&insert);
+ ide_source_view_movements_select_range (self, &insert, &selection, extend_selection);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]