aboutsummaryrefslogtreecommitdiffstats
path: root/src/todo.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-05-15 14:37:49 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-05-18 11:03:10 +0200
commit655218b7df40b3e159119933a4fa18efca2ff940 (patch)
treebbcefa98df1595151c33752ebc45fe2a5ec5336e /src/todo.c
parent4210fdd38a511f1ea2529eea2dfd5d55ab144e37 (diff)
downloadcalcurse-655218b7df40b3e159119933a4fa18efca2ff940.tar.gz
calcurse-655218b7df40b3e159119933a4fa18efca2ff940.zip
ui-todo: Large-scale refactoring
This is a complete overhaul of the TODO list user interface. The new implementation uses the generic list box panel. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/todo.c')
-rw-r--r--src/todo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/todo.c b/src/todo.c
index 50ee447..16f1e20 100644
--- a/src/todo.c
+++ b/src/todo.c
@@ -45,7 +45,7 @@ llist_t todolist;
/* Returns a structure containing the selected item. */
struct todo *todo_get_item(int item_number)
{
- return LLIST_GET_DATA(LLIST_NTH(&todolist, item_number - 1));
+ return LLIST_GET_DATA(LLIST_NTH(&todolist, item_number));
}
static int todo_cmp_id(struct todo *a, struct todo *b)
@@ -131,9 +131,9 @@ int todo_get_position(struct todo *needle)
int n = 0;
LLIST_FOREACH(&todolist, i) {
- n++;
if (LLIST_TS_GET_DATA(i) == needle)
return n;
+ n++;
}
EXIT(_("todo not found"));