w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 0859ff54090d9e1343bfa7d1404443bd65dcccf4
parent 099063cb08f3a7fcc52134ec132c93b5096571a4
Author: ukai <ukai>
Date:   Fri, 23 Nov 2001 21:05:52 +0000

add vi_prec_num

Diffstat:
MChangeLog | 6++++++
Mfm.h | 3+++
Mmain.c | 22++++++++++++----------
Mrc.c | 9+++++++++
4 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,11 @@ 2001-11-24 Fumitoshi UKAI <ukai@debian.or.jp + * fm.h (vi_prec_num): runtime option vi_prec_num + * main.c (pgFore): ditto + * main.c (pgBack): ditto + * rc.c (CMT_VI_PREC_NUM): ditto + * rc.c (params3): ditto + * fm.h (emacs_like_lineedit): runtime option emacs_like_lineedit * linein.c (inputLineHist): ditto * linein.c (_esc): ditto diff --git a/fm.h b/fm.h @@ -706,6 +706,9 @@ global int confirm_on_quit init(TRUE); #ifdef EMACS_LIKE_LINEEDIT global int emacs_like_lineedit init(FALSE); #endif +#ifdef VI_PREC_NUM +global int vi_prec_num init(FALSE); +#endif global int displayLink init(FALSE); global int retryAsHttp init(TRUE); global int showLineNum init(FALSE); diff --git a/main.c b/main.c @@ -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 @@ -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" @@ -396,6 +402,9 @@ struct param_ptr params3[] = #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}, #ifdef USE_MOUSE