From cc0b9339cde8f25939b635c63dfc8da490e6248c Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Fri, 23 Nov 2001 21:05:52 +0000 Subject: add vi_prec_num --- ChangeLog | 6 ++++++ fm.h | 5 ++++- main.c | 24 +++++++++++++----------- rc.c | 11 ++++++++++- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3ced0e..5f395c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2001-11-24 Fumitoshi UKAI @@ -1129,11 +1129,12 @@ void pgFore(void) { #ifdef VI_PREC_NUM - nscroll(searchKeyNum() * (LASTLINE - 1), B_NORMAL); -#else /* not VI_PREC_NUM */ - nscroll(prec_num ? searchKeyNum() : searchKeyNum() * (LASTLINE - 1), - prec_num ? B_SCROLL : B_NORMAL); -#endif /* not VI_PREC_NUM */ + if (vi_prec_num) + nscroll(searchKeyNum() * (LASTLINE - 1), B_NORMAL); + else +#endif + nscroll(prec_num ? searchKeyNum() : searchKeyNum() * (LASTLINE - 1), + prec_num ? B_SCROLL : B_NORMAL); } /* Move page backward */ @@ -1141,11 +1142,12 @@ void pgBack(void) { #ifdef VI_PREC_NUM - nscroll(- searchKeyNum() * (LASTLINE - 1), B_NORMAL); -#else /* not VI_PREC_NUM */ - nscroll(- (prec_num ? searchKeyNum() : searchKeyNum() * (LASTLINE - 1)), - prec_num ? B_SCROLL : B_NORMAL); -#endif /* not VI_PREC_NUM */ + if (vi_prec_num) + nscroll(- searchKeyNum() * (LASTLINE - 1), B_NORMAL); + else +#endif + nscroll(-(prec_num ? searchKeyNum() : searchKeyNum() * (LASTLINE - 1)), + prec_num ? B_SCROLL : B_NORMAL); } /* 1 line up */ diff --git a/rc.c b/rc.c index e12fdc2..5b70bfd 100644 --- a/rc.c +++ b/rc.c @@ -1,4 +1,4 @@ -/* $Id: rc.c,v 1.9 2001/11/23 20:50:59 ukai Exp $ */ +/* $Id: rc.c,v 1.10 2001/11/23 21:05:52 ukai Exp $ */ /* * Initialization file etc. */ @@ -92,6 +92,9 @@ static int rc_initialized = 0; #ifdef EMACS_LIKE_LINEEDIT #define CMT_EMACS_LIKE_LINEEDIT "Emacs風の行編集にする" #endif +#ifdef VI_PREC_NUM +#define CMT_VI_PREC_NUM "vi風の数値プレフィクス" +#endif #define CMT_SHOW_NUM "行番号を表示する" #define CMT_MIMETYPES "利用するmime.types" #define CMT_MAILCAP "利用するmailcap" @@ -193,6 +196,9 @@ static int rc_initialized = 0; #ifdef EMACS_LIKE_LINEEDIT #define CMT_EMACS_LIKE_LINEEDIT "Emacs-style line editing" #endif +#ifdef VI_PREC_NUM +#define CMT_VI_PREC_NUM "vi-like numeric prefix" +#endif #define CMT_SHOW_NUM "Show line number" #define CMT_MIMETYPES "mime.types files" #define CMT_MAILCAP "mailcap files" @@ -395,6 +401,9 @@ struct param_ptr params3[] = {"confirm_qq", P_INT, PI_ONOFF, (void *) &confirm_on_quit, CMT_CONFIRM_QQ, NULL}, #ifdef EMACS_LIKE_LINEEDIT {"emacs_like_lineedit", P_INT, PI_ONOFF, (void *) &emacs_like_lineedit, CMT_EMACS_LIKE_LINEEDIT, NULL }, +#endif +#ifdef VI_PREC_NUM + {"vi_prec_num", P_INT, PI_ONOFF, (void *) &vi_prec_num, CMT_VI_PREC_NUM }, #endif {"wrap_search", P_INT, PI_ONOFF, (void *) &WrapDefault, CMT_WRAP, NULL}, {"ignorecase_search", P_INT, PI_ONOFF, (void *) &IgnoreCase, CMT_IGNORE_CASE, NULL}, -- cgit v1.2.3