From: Jaakko Heinonen Date: Wed, 30 May 2001 06:43:11 +0000 (+0000) Subject: Added editor commands X-Git-Tag: upstream/0.6.1~2^2~373 X-Git-Url: https://git.deb.at/?p=pkg%2Fabook.git;a=commitdiff_plain;h=3a500c48898f7a279a98bfc259955a2e47bbfc48 Added editor commands --- diff --git a/ChangeLog b/ChangeLog index 2d71e8d..8875544 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ - changed SIGINT behaviour - html export filter creates now valid html documents - ablity to print/export only selected items + - new editor commands 0.4.12 - added man page for abookrc (Alan Ford) diff --git a/configure b/configure index 2ac8ce6..8e27167 100755 --- a/configure +++ b/configure @@ -697,7 +697,7 @@ fi PACKAGE=abook -VERSION=0.4.13pre1 +VERSION=0.4.13pre2-cvs if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff --git a/configure.in b/configure.in index b8a13b7..9a9a252 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl abook configure.in AC_INIT(abook.c) -AM_INIT_AUTOMAKE(abook, 0.4.13pre1) +AM_INIT_AUTOMAKE(abook, 0.4.13pre2-cvs) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST diff --git a/edit.c b/edit.c index ae7643e..e41d707 100644 --- a/edit.c +++ b/edit.c @@ -374,16 +374,20 @@ edit_loop(int item) break; case KEY_RIGHT: tab = tab == MAX_TAB ? 0 : tab + 1; break; + case '<': + case 'k': if(is_valid_item(item-1)) item--; break; + case '>': + case 'j': if(is_valid_item(item+1)) item++; break; case 'r': roll_emails(item); break; case '?': display_help(HELP_EDITOR); break; case 'u': edit_undo(item, RESTORE_ITEM); break; case 'm': launch_mutt(item); case 'v': launch_wwwbrowser(item); case 12 : clearok(stdscr, 1); break; /* ^L (refresh screen) */ - default: return edit_field(tab, c, item); + default: return edit_field(tab, c, item) ? item : -1; } - return 1; + return item; } void @@ -397,8 +401,9 @@ edit_item(int item) } init_editor(); - while( edit_loop(item) ) - ; + + while( (item = edit_loop(item)) >= 0 ) + curitem = item; /* hmm, this is not very clean way to go */ close_editor(); } diff --git a/help.h b/help.h index 2f1120d..a18f8f2 100644 --- a/help.h +++ b/help.h @@ -51,6 +51,9 @@ static char *editorhelp[] = { "\n", " 1 - 5 edit fields\n", "\n", +" k or < previous item\n", +" j or > next item\n", +"\n", " r roll e-mail addresses\n", "\n", " u undo\n",