aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-23 21:22:02 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-23 21:22:02 +0000
commit67012ecb75eb480953e09697f41164218595c52e (patch)
tree549cdabf747df1154957b699008ef70d22cf7b43
parentdefault is TRUE (diff)
downloadw3m-67012ecb75eb480953e09697f41164218595c52e.tar.gz
w3m-67012ecb75eb480953e09697f41164218595c52e.zip
add label_topline
-rw-r--r--ChangeLog6
-rw-r--r--file.c18
-rw-r--r--fm.h5
-rw-r--r--main.c17
-rw-r--r--rc.c13
5 files changed, 41 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f395c8..69b01d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2001-11-24 Fumitoshi UKAI <ukai@debian.or.jp
+ * fm.h (label_topline): runtime option label_topline
+ * file.c (loadGeneralFile): ditto
+ * main.c (loadLink): ditto
+ * rc.c (CMT_LABEL_TOPLINE): ditto
+ * rc.c (params3): ditto
+
* fm.h (vi_prec_num): runtime option vi_prec_num
* main.c (pgFore): ditto
* main.c (pgBack): ditto
diff --git a/file.c b/file.c
index 773cfb6..b1b72a6 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.11 2001/11/21 19:24:35 ukai Exp $ */
+/* $Id: file.c,v 1.12 2001/11/23 21:22:02 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -1319,18 +1319,20 @@ loadGeneralFile(char *path, ParsedURL * current, char *referer, int flag, FormLi
b->type = "text/plain";
if (pu.label) {
if (proc == loadHTMLBuffer) {
- Anchor *a;
+ Anchor *a;
#ifdef JP_CHARSET
- a = searchURLLabel(b, conv(pu.label, b->document_code, InnerCode)->ptr);
+ a = searchURLLabel(b, conv(pu.label, b->document_code, InnerCode)->ptr);
#else /* not JP_CHARSET */
- a = searchURLLabel(b, pu.label);
+ a = searchURLLabel(b, pu.label);
#endif /* not JP_CHARSET */
- if (a != NULL) {
+ if (a != NULL) {
gotoLine(b, a->start.line);
#ifdef LABEL_TOPLINE
- b->topLine = lineSkip(b, b->topLine,
- b->currentLine->linenumber - b->topLine->linenumber,
- FALSE);
+ if (label_topline)
+ b->topLine = lineSkip(b, b->topLine,
+ b->currentLine->linenumber
+ - b->topLine->linenumber,
+ FALSE);
#endif
b->pos = a->start.pos;
arrangeCursor(b);
diff --git a/fm.h b/fm.h
index 91b42cd..f5a2183 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.16 2001/11/23 21:06:24 ukai Exp $ */
+/* $Id: fm.h,v 1.17 2001/11/23 21:22:02 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -709,6 +709,9 @@ global int emacs_like_lineedit init(TRUE);
#ifdef VI_PREC_NUM
global int vi_prec_num init(TRUE);
#endif
+#ifdef LABEL_TOPLINE
+global int label_topline 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 043e735..2f2d3d1 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.19 2001/11/23 21:05:52 ukai Exp $ */
+/* $Id: main.c,v 1.20 2001/11/23 21:22:02 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -2374,9 +2374,10 @@ loadLink(char *url, char *target, char *referer, FormList * request)
if (al) {
gotoLine(Currentbuf, al->start.line);
#ifdef LABEL_TOPLINE
- Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine,
- Currentbuf->currentLine->linenumber - Currentbuf->topLine->linenumber,
- FALSE);
+ if (label_topline)
+ Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine,
+ Currentbuf->currentLine->linenumber - Currentbuf->topLine->linenumber,
+ FALSE);
#endif
Currentbuf->pos = al->start.pos;
arrangeCursor(Currentbuf);
@@ -2408,9 +2409,11 @@ gotoLabel(char *label)
pushBuffer(buf);
gotoLine(Currentbuf, al->start.line);
#ifdef LABEL_TOPLINE
- Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine,
- Currentbuf->currentLine->linenumber - Currentbuf->topLine->linenumber,
- FALSE);
+ if (label_topline)
+ Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine,
+ Currentbuf->currentLine->linenumber
+ - Currentbuf->topLine->linenumber,
+ FALSE);
#endif
Currentbuf->pos = al->start.pos;
arrangeCursor(Currentbuf);
diff --git a/rc.c b/rc.c
index 5b70bfd..aac3356 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.10 2001/11/23 21:05:52 ukai Exp $ */
+/* $Id: rc.c,v 1.11 2001/11/23 21:22:02 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -95,6 +95,9 @@ static int rc_initialized = 0;
#ifdef VI_PREC_NUM
#define CMT_VI_PREC_NUM "vi風の数値プレフィクス"
#endif
+#ifdef LABEL_TOPLINE
+#define CMT_LABEL_TOPLINE "ラベルに移動する時に行頭になるようにする"
+#endif
#define CMT_SHOW_NUM "行番号を表示する"
#define CMT_MIMETYPES "利用するmime.types"
#define CMT_MAILCAP "利用するmailcap"
@@ -199,6 +202,9 @@ static int rc_initialized = 0;
#ifdef VI_PREC_NUM
#define CMT_VI_PREC_NUM "vi-like numeric prefix"
#endif
+#ifdef LABEL_TOPLINE
+#define CMT_LABEL_TOPLINE "move cursor to top line when going to label"
+#endif
#define CMT_SHOW_NUM "Show line number"
#define CMT_MIMETYPES "mime.types files"
#define CMT_MAILCAP "mailcap files"
@@ -403,7 +409,10 @@ struct param_ptr params3[] =
{"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 },
+ {"vi_prec_num", P_INT, PI_ONOFF, (void *) &vi_prec_num, CMT_VI_PREC_NUM, NULL },
+#endif
+#ifdef LABEL_TOPLINE
+ {"label_topline", P_INT, PI_ONOFF, (void *) &label_topline, CMT_LABEL_TOPLINE, NULL },
#endif
{"wrap_search", P_INT, PI_ONOFF, (void *) &WrapDefault, CMT_WRAP, NULL},
{"ignorecase_search", P_INT, PI_ONOFF, (void *) &IgnoreCase, CMT_IGNORE_CASE, NULL},