[gnome-builder] editor: iterate backwards when deleting lines
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] editor: iterate backwards when deleting lines
- Date: Sat, 13 Sep 2014 17:11:41 +0000 (UTC)
commit d1007f669db3e0e61892b4a7123daf98d5c1b457
Author: Christian Hergert <christian hergert me>
Date: Sat Sep 13 10:11:33 2014 -0700
editor: iterate backwards when deleting lines
Otherwise, line numbers will be off.
src/editor/gb-source-change-monitor.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/editor/gb-source-change-monitor.c b/src/editor/gb-source-change-monitor.c
index 8048377..6a39022 100644
--- a/src/editor/gb-source-change-monitor.c
+++ b/src/editor/gb-source-change-monitor.c
@@ -146,8 +146,8 @@ on_delete_range_before_cb (GbSourceChangeMonitor *monitor,
return;
}
- for (i = begin_line; i < end_line; i++)
- gb_source_change_monitor_remove (monitor, i);
+ for (i = end_line; i > 0; i--)
+ gb_source_change_monitor_remove (monitor, i - 1);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]