Menu

#139 Previous Message, Previous Error commands

closed
None
5
2008-07-11
2008-04-01
Beau Barker
No

There's a Next Message command in the Search menu, which I use all the time, but why is there no Previous Message command?

I would greatly appreciate this feature

Discussion

  • Nick Treleaven

    Nick Treleaven - 2008-04-01

    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?

     
  • Nick Treleaven

    Nick Treleaven - 2008-04-01
    • assigned_to: nobody --> ntrel
    • status: open --> pending
     
  • Beau Barker

    Beau Barker - 2008-04-02

    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

     
  • Beau Barker

    Beau Barker - 2008-04-02
    • status: pending --> open
     
  • Nick Treleaven

    Nick Treleaven - 2008-04-03
    • summary: Previous Message command --> Previous Message, Previous Error commands
     
  • Nick Treleaven

    Nick Treleaven - 2008-04-03

    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.

     
  • Beau Barker

    Beau Barker - 2008-04-06

    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;
    }

     
  • Forest

    Forest - 2008-04-07

    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.

     
  • Forest

    Forest - 2008-05-19

    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. :)

     
  • Nick Treleaven

    Nick Treleaven - 2008-05-21

    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.

     
  • Nick Treleaven

    Nick Treleaven - 2008-05-21
    • assigned_to: ntrel --> nobody
     
  • Nick Treleaven

    Nick Treleaven - 2008-06-25
    • assigned_to: nobody --> ntrel
     
  • Nick Treleaven

    Nick Treleaven - 2008-06-26

    Logged In: YES
    user_id=1268692
    Originator: NO

    Now implemented these commands in SVN.

     
  • Nick Treleaven

    Nick Treleaven - 2008-06-26
    • status: open --> pending
     
  • SourceForge Robot

    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).

     
  • SourceForge Robot

    • status: pending --> closed
     

Log in to post a comment.