コード例 #1
0
ファイル: history.c プロジェクト: 42rdavid/42sh
int				ft_history(char **c, t_list *envi)
{
	(void)envi;
	if (c[1] != NULL)
	{
		print_list_line(g_data->last);
		tputs(tgetstr("sc", NULL), 1, tputs_char);
	}
	else
	{
		print_list_line(g_data->last);
		tputs(tgetstr("sc", NULL), 1, tputs_char);
	}
	return (1);
}
コード例 #2
0
ファイル: list.c プロジェクト: jens-na/abook-call
void
refresh_list()
{
	int i, line;

	werase(list);

	ui_print_number_of_items();

	if(list_is_empty()) {
		refresh();
		wrefresh(list);
		return;
	}

	if(curitem < 0)
		curitem = 0;

	if(first_list_item < 0)
		first_list_item = 0;

	if(curitem < first_list_item)
		first_list_item = curitem;
	else if(curitem > LAST_LIST_ITEM)
		first_list_item = max(curitem - LIST_LINES + 1, 0);

        for(line = 0, i = first_list_item;
			i <= LAST_LIST_ITEM && i < db_n_items();
			line++, i++) {

		print_list_line(i, line, i == curitem);
        }

	if(opt_get_bool(BOOL_SHOW_CURSOR)) {
		wmove(list, curitem - first_list_item, 0);
		/* need to call refresh() to update the cursor positions */
		refresh();
	}
        wrefresh(list);
}