Skip to content

Commit

Permalink
Fix in sidebar-next functionality
Browse files Browse the repository at this point in the history
The first item in sidebar was always selected, even if there were no new
messages. Now the sidebar-new function works as it should.
  • Loading branch information
juliushaertl committed Sep 9, 2014
1 parent bc0d2ac commit d9026ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions functions.h
Expand Up @@ -302,6 +302,7 @@ const struct binding_t OpPager[] = { /* map: pager */
{ "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
{ "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
{ "sidebar-open", OP_SIDEBAR_OPEN, NULL },
{ "sidebar-new", OP_SIDEBAR_NEW, NULL },
{ "sidebar-toggle", OP_SIDEBAR_TOGGLE, NULL },

{ NULL, 0, NULL }
Expand Down
8 changes: 6 additions & 2 deletions sidebar.c
Expand Up @@ -537,8 +537,12 @@ void scroll_sidebar(int op, int menu)
break;
case OP_SIDEBAR_NEW:
if ( (tmp = exist_next_new()) == NULL)
CurBuffy = TopBuffy;
else
tmp = TopBuffy;
if ( tmp->msg_unread == 0 ) {
CurBuffy = tmp;
tmp = exist_next_new();
}
if ( tmp != NULL )
CurBuffy = tmp;
break;
default:
Expand Down

0 comments on commit d9026ea

Please sign in to comment.