[gtksourceview/wip/fix-move-lines: 1/3] move-lines: simplify a condition and remove dead code
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/fix-move-lines: 1/3] move-lines: simplify a condition and remove dead code
- Date: Thu, 30 Mar 2017 13:47:25 +0000 (UTC)
commit a0090d89f1a12b29e9ed08ebd83894d1cb71fbe5
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Mar 30 14:35:12 2017 +0200
move-lines: simplify a condition and remove dead code
gtk_text_iter_get_line() can never be equal to
gtk_text_buffer_get_line_count(), it was dead code.
start is always at line offset 0, so we can use
gtk_text_iter_is_start(), to have symmetric code with
gtk_text_iter_is_end().
gtksourceview/gtksourceview.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index ae90ec2..028b1c3 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -3732,9 +3732,8 @@ gtk_source_view_move_lines (GtkSourceView *view,
gtk_text_iter_forward_line (&end);
}
- if ((!down && (0 == gtk_text_iter_get_line (&start))) ||
- (down && (gtk_text_iter_is_end (&end))) ||
- (down && (gtk_text_buffer_get_line_count (buffer) == gtk_text_iter_get_line (&end))))
+ if ((!down && gtk_text_iter_is_start (&start)) ||
+ (down && gtk_text_iter_is_end (&end)))
{
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]