[gnome-builder] source-view-movement: defferentiate not applying count
- From: Sébastien Lafargue <slafargue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] source-view-movement: defferentiate not applying count
- Date: Mon, 16 Nov 2015 20:06:35 +0000 (UTC)
commit f8c70d0e28445031f4947dab8c14bafdf12f4508
Author: Sebastien Lafargue <slafargue gnome org>
Date: Mon Nov 16 21:00:16 2015 +0100
source-view-movement: defferentiate not applying count
We need to differentiate between not applying the count
and having no count, wich mean a default count of 1
libide/ide-source-view-movements.c | 8 ++------
libide/ide-source-view.c | 2 +-
2 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/libide/ide-source-view-movements.c b/libide/ide-source-view-movements.c
index e808987..add0a2e 100644
--- a/libide/ide-source-view-movements.c
+++ b/libide/ide-source-view-movements.c
@@ -1958,7 +1958,7 @@ _ide_source_view_apply_movement (IdeSourceView *self,
Movement mv = { 0 };
GtkTextBuffer *buffer;
GtkTextMark *insert;
- gint min_count;
+ gint min_count = 1;
gsize i;
g_return_if_fail (IDE_IS_SOURCE_VIEW (self));
@@ -1983,15 +1983,11 @@ _ide_source_view_apply_movement (IdeSourceView *self,
insert = gtk_text_buffer_get_insert (buffer);
/* specific processing for underscore motion */
- if (g_str_has_suffix (command_str->str, "_"))
+ if (g_str_has_suffix (command_str->str, "_") && count > 0)
{
min_count = 0;
--count;
}
- else
- {
- min_count = 1;
- }
mv.self = self;
mv.target_offset = target_offset;
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 53d3f89..da8648d 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -3134,7 +3134,7 @@ ide_source_view_real_movement (IdeSourceView *self,
g_assert (IDE_IS_SOURCE_VIEW (self));
if (apply_count)
- count = priv->count;
+ count = MAX(1, priv->count);
if (priv->scrolling_to_scroll_mark)
priv->scrolling_to_scroll_mark = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]