aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-23 21:05:52 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-23 21:05:52 +0000
commitcc0b9339cde8f25939b635c63dfc8da490e6248c (patch)
tree3cea0fb3ad995d2ebb7bf1965ccceb172854f2dd
parentadd emacs_like_lineedit (diff)
downloadw3m-cc0b9339cde8f25939b635c63dfc8da490e6248c.tar.gz
w3m-cc0b9339cde8f25939b635c63dfc8da490e6248c.zip
add vi_prec_num
-rw-r--r--ChangeLog6
-rw-r--r--fm.h5
-rw-r--r--main.c24
-rw-r--r--rc.c11
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 <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
index 14f6c42..4cda755 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.14 2001/11/23 20:50:59 ukai Exp $ */
+/* $Id: fm.h,v 1.15 2001/11/23 21:05:52 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -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
index c1de7a9..043e735 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.18 2001/11/23 20:06:40 ukai Exp $ */
+/* $Id: main.c,v 1.19 2001/11/23 21:05:52 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -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"
@@ -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