From a24b80f8fd5c0f3dddcc395f8f9ed1b802839637 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 4 May 2004 18:42:04 +0000 Subject: Don't necessarily set row to 0 if the root node has the cursor (otherwise 2004-05-04 Jeffrey Stedfast * e-tree.c (e_tree_find_next): Don't necessarily set row to 0 if the root node has the cursor (otherwise message_list_select() first unread will actually select the second unread if the first unread is the first in the list). Fixes a bug that's been pissing me off for years. svn path=/trunk/; revision=25789 --- widgets/table/e-tree.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index e3fc19052f..fc684c5f61 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -2068,14 +2068,12 @@ e_tree_find_next (ETree *et, ETreeFindNextParams params, ETreePathFunc func, gpo cursor = e_tree_get_cursor (et); row = e_tree_table_adapter_row_of_node (et->priv->etta, cursor); row_count = e_table_model_row_count (E_TABLE_MODEL (et->priv->etta)); - if (row == -1) - row = 0; - + if (params & E_TREE_FIND_NEXT_FORWARD) found = find_next_in_range (et, row + 1, row_count - 1, func, data); else - found = find_prev_in_range (et, row - 1, 0, func, data); - + found = find_prev_in_range (et, row == -1 ? -1 : row - 1, 0, func, data); + if (found) { e_tree_table_adapter_show_node (et->priv->etta, found); e_tree_set_cursor (et, found); -- cgit v1.2.3