From: Jaakko Heinonen Date: Sun, 29 May 2005 16:32:24 +0000 (+0000) Subject: add show_cursor config option X-Git-Tag: upstream/0.6.1~2^2~204 X-Git-Url: https://git.deb.at/?p=pkg%2Fabook.git;a=commitdiff_plain;h=ebb3a365ead9d1898c92fccaf53f118faa1b6fbf add show_cursor config option --- diff --git a/ChangeLog b/ChangeLog index ba73747..18f0564 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +0.5.4 + - add show_cursor config option (idea from Cheryl Homiak) + 0.5.3 - add allcvs filters (Christoph Sobotka) - removed a lefover debug message diff --git a/abookrc.5 b/abookrc.5 index eaedf7d..0602c98 100644 --- a/abookrc.5 +++ b/abookrc.5 @@ -103,6 +103,10 @@ Defines whether to avoid adding addresses already in data. Default is false. \fBsort_field\fP=field Defines the field to be used by the "sort by field" command. Default is "nick" (Nickname/Alias). +.TP +\fBshow_cursor\fP=[true|false] +Defines if the cursor is visible in main display. Default is false. + .SH SAMPLE CONFIGURATION FILE .nf @@ -159,6 +163,9 @@ set add_email_prevent_duplicates=false # field to be used with "sort by field" command set sort_field=nick +# show cursor in main display +set show_cursor=false + .fi .SH SEE ALSO diff --git a/list.c b/list.c index 6215952..9f293e9 100644 --- a/list.c +++ b/list.c @@ -110,6 +110,11 @@ refresh_list() 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); } diff --git a/options.c b/options.c index 41bde1b..81fecde 100644 --- a/options.c +++ b/options.c @@ -66,6 +66,7 @@ static struct option abook_vars[] = { { "add_email_prevent_duplicates", OT_BOOL, BOOL_ADD_EMAIL_PREVENT_DUPLICATES, FALSE }, { "sort_field", OT_STR, STR_SORT_FIELD, UL "nick" }, + { "show_cursor", OT_BOOL, BOOL_SHOW_CURSOR, FALSE }, { NULL } }; diff --git a/options.h b/options.h index cfdaa6c..73b300c 100644 --- a/options.h +++ b/options.h @@ -18,6 +18,7 @@ enum bool_opts { BOOL_MUTT_RETURN_ALL_EMAILS, BOOL_USE_ASCII_ONLY, BOOL_ADD_EMAIL_PREVENT_DUPLICATES, + BOOL_SHOW_CURSOR, BOOL_MAX }; diff --git a/sample.abookrc b/sample.abookrc index bc352f3..086235f 100644 --- a/sample.abookrc +++ b/sample.abookrc @@ -52,6 +52,9 @@ set add_email_prevent_duplicates=false # field to be used with "sort by field" command set sort_field=nick +# show cursor in main display +set show_cursor=false + # custom fields #customfield 1 Name1 diff --git a/ui.c b/ui.c index d99397d..2799039 100644 --- a/ui.c +++ b/ui.c @@ -375,13 +375,15 @@ get_commands() for(;;) { can_resize = TRUE; /* it's safe to resize now */ - hide_cursor(); - if( should_resize ) + if(!opt_get_bool(BOOL_SHOW_CURSOR)) + hide_cursor(); + if(should_resize) refresh_screen(); ch = getch(); - show_cursor(); + if(!opt_get_bool(BOOL_SHOW_CURSOR)) + show_cursor(); can_resize = FALSE; /* it's not safe to resize anymore */ - switch( ch ) { + switch(ch) { case 'q': return; case 'Q': quit_abook(QUIT_DONTSAVE); break; case 'P': print_stderr(selected_items() ?