[gtksourceview/gnome-3-24] 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/gnome-3-24] move-lines: simplify a condition and remove dead code
- Date: Thu, 30 Mar 2017 15:41:30 +0000 (UTC)
commit 587b508a727b9f9149c2e1875e332c64f5fc5336
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 cecc2e0..d1ae95f 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -3770,9 +3770,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]