aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/main.c b/main.c
index b43f832..1dbfbd1 100644
--- a/main.c
+++ b/main.c
@@ -1392,15 +1392,22 @@ int main(int argc, char *argv[]) {
}
input_pos_x++;
- sprintf(string_buffer, "%*s", input_width, "");
- mvaddstr(selected_task_row, input_pos_x, string_buffer);
// Get time delta.
- echo();
- curs_set(1);
- mvgetnstr(selected_task_row, input_pos_x, string_buffer, input_width);
- noecho();
- curs_set(0);
+ // TODO Maybe use that function referred in 'g' here?
+ {
+ attron(A_UNDERLINE);
+
+ sprintf(string_buffer, "%*s", input_width, "");
+ mvaddstr(selected_task_row, input_pos_x, string_buffer);
+
+ echo();
+ curs_set(1);
+ mvgetnstr(selected_task_row, input_pos_x, string_buffer, input_width);
+ noecho();
+ curs_set(0);
+ attroff(A_UNDERLINE);
+ }
attrset(A_NORMAL);
@@ -1558,17 +1565,22 @@ int main(int argc, char *argv[]) {
move(selected_task_row, 1);
addch(ACS_CKBOARD);
addstr(" Go to: ");
- int input_pos_x = getcurx(stdscr);
- sprintf(string_buffer, "%*s", size_x - input_pos_x - 1, "");
- attron(A_UNDERLINE);
- addstr(string_buffer);
// Get line number.
- echo();
- curs_set(1);
- mvgetnstr(selected_task_row, input_pos_x, string_buffer, size_x - input_pos_x - 1);
- noecho();
- curs_set(0);
+ // TODO Maybe convert this code block on a function?
+ {
+ int input_pos_x = getcurx(stdscr);
+ sprintf(string_buffer, "%*s", size_x - input_pos_x - 1, "");
+ attron(A_UNDERLINE);
+ addstr(string_buffer);
+
+ echo();
+ curs_set(1);
+ mvgetnstr(selected_task_row, input_pos_x, string_buffer, size_x - input_pos_x - 1);
+ noecho();
+ curs_set(0);
+ attroff(A_UNDERLINE);
+ }
attrset(A_NORMAL);