Hi,
We hadn't got around to implementing it. But as we already have a navigation queue with forwards/backwards commands, I think we can use this instead, if we make clicking on a Messages item add to the navqueue. I've just implemented this in SVN.
Is this sufficient, or do you still want a real Previous Message command?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The nav queue is a great feature but I'd prefer to be able to move around the messages whether I've "been to them" or not
There's also no "Previous Error" command to go with Next Error
I just quickly tried to add these features to the geany code myself and I've realized a possible reason they might not have been done before: GTK has a gtk_tree_model_iter_next function but no gtk_tree_model_iter_prev, so it might not be so easy to do
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Fair enough, Previous Message and Previous Error commands could be added to Geany.
If you have time, you might like to look at gtk_tree_path_prev() using a GtkTreePath instead of a GtkTreeIter, this should do what you want. For an example of using it, see find_prev_build_dir() in msgwindow.c.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> as we already have a navigation queue with forwards/backwards
> commands, I think we can use this instead
I use the forward/backward commands to retrace my steps after several nested "go to definition" commands. I think I would get confused pretty easily if my only way of navigating these jumps started including other kinds of jumps as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
+1 on this. A previous-error command to match next-error would be very helpful.
In particular, I would like them to remain separate from the forward/back commands that I use to navigate go-to-definition jumps. (I keep different mental stacks for finding definitions and errors, and mingling them would confuse me. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
skip76: Sorry for the late reply, and thanks for writing that function. But unfortunately I need to work on the plugin API ATM, so won't add the basic keybinding code for it yet.
forest: We will add the Previous commands soon, but I'm not sure about making the navigate forwards/backwards commands only work for tags. Perhaps a compromise can be found, but I'm not sure yet. If you want you could start a discussion on the mailing list.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1268692
Originator: NO
Hi,
We hadn't got around to implementing it. But as we already have a navigation queue with forwards/backwards commands, I think we can use this instead, if we make clicking on a Messages item add to the navqueue. I've just implemented this in SVN.
Is this sufficient, or do you still want a real Previous Message command?
Logged In: YES
user_id=2051461
Originator: YES
Hi Nick,
The nav queue is a great feature but I'd prefer to be able to move around the messages whether I've "been to them" or not
There's also no "Previous Error" command to go with Next Error
I just quickly tried to add these features to the geany code myself and I've realized a possible reason they might not have been done before: GTK has a gtk_tree_model_iter_next function but no gtk_tree_model_iter_prev, so it might not be so easy to do
Logged In: YES
user_id=1268692
Originator: NO
Fair enough, Previous Message and Previous Error commands could be added to Geany.
If you have time, you might like to look at gtk_tree_path_prev() using a GtkTreePath instead of a GtkTreeIter, this should do what you want. For an example of using it, see find_prev_build_dir() in msgwindow.c.
Logged In: YES
user_id=2051461
Originator: YES
Thanks, that did the trick. Both commands working perfectly
/* Returns FALSE if the treeview has items but no matching prev item. */
gboolean ui_tree_view_find_prev(GtkTreeView *treeview, TVMatchCallback cb)
{
GtkTreeSelection *treesel;
GtkTreeIter iter;
GtkTreeModel *model;
treesel = gtk_tree_view_get_selection(treeview);
if (gtk_tree_selection_get_selected(treesel, &model, &iter))
{
/* get the prev selected item */
GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
if (!(gtk_tree_path_prev(path) && gtk_tree_model_get_iter(model, &iter, path)))
{
return FALSE;
}
}
else /* no selection */
{
if (! gtk_tree_model_get_iter_first(model, &iter))
return TRUE; /* no items */
}
while (TRUE)
{
gtk_tree_selection_select_iter(treesel, &iter);
if (cb())
break; /* found prev message */
GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
if (!(gtk_tree_path_prev(path) && gtk_tree_model_get_iter(model, &iter, path)))
return FALSE; /* no more items */
}
/* scroll item in view */
if (ui_prefs.msgwindow_visible)
{
GtkTreePath *path = gtk_tree_model_get_path(
gtk_tree_view_get_model(treeview), &iter);
gtk_tree_view_scroll_to_cell(treeview, path, NULL, TRUE, 0.5, 0.5);
gtk_tree_path_free(path);
}
return TRUE;
}
Logged In: YES
user_id=27617
Originator: NO
> as we already have a navigation queue with forwards/backwards
> commands, I think we can use this instead
I use the forward/backward commands to retrace my steps after several nested "go to definition" commands. I think I would get confused pretty easily if my only way of navigating these jumps started including other kinds of jumps as well.
Logged In: YES
user_id=27617
Originator: NO
+1 on this. A previous-error command to match next-error would be very helpful.
In particular, I would like them to remain separate from the forward/back commands that I use to navigate go-to-definition jumps. (I keep different mental stacks for finding definitions and errors, and mingling them would confuse me. :)
Logged In: YES
user_id=1268692
Originator: NO
skip76: Sorry for the late reply, and thanks for writing that function. But unfortunately I need to work on the plugin API ATM, so won't add the basic keybinding code for it yet.
forest: We will add the Previous commands soon, but I'm not sure about making the navigate forwards/backwards commands only work for tags. Perhaps a compromise can be found, but I'm not sure yet. If you want you could start a discussion on the mailing list.
Logged In: YES
user_id=1268692
Originator: NO
Now implemented these commands in SVN.
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).