summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 60ba823)
raw | patch | inline | side by side (parent: 60ba823)
author | Kalle Wallin <kaw@linux.se> | |
Sat, 19 Jun 2004 19:32:19 +0000 (19:32 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Sat, 19 Jun 2004 19:32:19 +0000 (19:32 +0000) |
src/screen_utils.c | patch | blob | history |
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 16359c6eaa966aa27e3dd70200d9afc833a3ca10..d6e19fa3ec1047c674ed83bd2c8638d1d957fcd8 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
void
screen_display_completion_list(screen_t *screen, GList *list)
{
+ static GList *prev_list = NULL;
+ static gint prev_length = 0;
+ static gint offset = 0;
WINDOW *w = screen->main_window.w;
- gint y=0;
+ gint length, y=0;
+
+ length = g_list_length(list);
+ if( list==prev_list && length==prev_length )
+ {
+ offset += screen->main_window.rows;
+ if( offset>=length )
+ offset=0;
+ }
+ else
+ {
+ prev_list = list;
+ prev_length = length;
+ offset = 0;
+ }
colors_use(w, COLOR_STATUS_ALERT);
while( y<screen->main_window.rows )
{
+ GList *item = g_list_nth(list, y+offset);
+
wmove(w, y++, 0);
wclrtoeol(w);
- if( list )
+ if( item )
{
- gchar *tmp = g_strdup(list->data);
+ gchar *tmp = g_strdup(item->data);
waddstr(w, basename(tmp));
g_free(tmp);
- list = list->next;
}
}
wrefresh(w);