Return a boolean indicating whether we could do the requested move.
2004-11-28 Matthias Clasen <mclasen@redhat.com> * gtk/gtktextview.c (gtk_text_view_move_iter_by_lines): Return a boolean indicating whether we could do the requested move. (gtk_text_view_move_cursor_internal): For GTK_MOVEMENT_DISPLAY_LINES, move to the beginning/end of the line if we're on the first/last line. (#155891, Paolo Borelli)
This commit is contained in:
committed by
Matthias Clasen
parent
f22bb95581
commit
22ff56c753
@ -2752,12 +2752,17 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout,
|
||||
{
|
||||
line_byte = layout_line->start_index + layout_line->length;
|
||||
}
|
||||
|
||||
|
||||
if (line_byte < layout_line->length || !tmp_list->next) /* first line of paragraph */
|
||||
{
|
||||
GtkTextLine *prev_line;
|
||||
|
||||
prev_line = _gtk_text_line_previous (line);
|
||||
|
||||
/* first line of the whole buffer, do not move the iter and return FALSE */
|
||||
if (prev_line == NULL)
|
||||
goto out;
|
||||
|
||||
while (prev_line)
|
||||
{
|
||||
gtk_text_layout_free_line_display (layout, display);
|
||||
@ -2776,9 +2781,6 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout,
|
||||
|
||||
prev_line = _gtk_text_line_previous (prev_line);
|
||||
}
|
||||
|
||||
if (prev_line == NULL)
|
||||
line_display_index_to_iter (layout, display, iter, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user