diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-23 21:22:02 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-23 21:22:02 +0000 |
commit | 67012ecb75eb480953e09697f41164218595c52e (patch) | |
tree | 549cdabf747df1154957b699008ef70d22cf7b43 | |
parent | default is TRUE (diff) | |
download | w3m-67012ecb75eb480953e09697f41164218595c52e.tar.gz w3m-67012ecb75eb480953e09697f41164218595c52e.zip |
add label_topline
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | file.c | 18 | ||||
-rw-r--r-- | fm.h | 5 | ||||
-rw-r--r-- | main.c | 17 | ||||
-rw-r--r-- | rc.c | 13 |
5 files changed, 41 insertions, 18 deletions
@@ -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 @@ -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); @@ -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); @@ -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); @@ -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}, |