w3m

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

commit c6bd580190a0577a86d94ee837d15dc834151a70
parent c853d37eefabe23e2870a4a8a77248a6ce3483ca
Author: ukai <ukai>
Date:   Fri, 23 Nov 2001 21:40:19 +0000

add nextpage_topline

Diffstat:
MChangeLog | 8+++++++-
Metc.c | 9+++++----
Mfm.h | 3+++
Mmain.c | 7++++---
Mrc.c | 11++++++++++-
5 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,11 @@ -2001-11-24 Fumitoshi UKAI <ukai@debian.or.jp +2001-11-24 Fumitoshi UKAI <ukai@debian.or.jp> + * fm.h (nextpage_topline): runtime option nextpage_topline + * etc.c (lineSkip): ditto + * main.c (nscroll): ditto + * rc.c (CMT_NEXTPAGE_TOPLINE): ditto + * rc.c (params3): ditto + * fm.h (label_topline): runtime option label_topline * file.c (loadGeneralFile): ditto * main.c (loadLink): ditto diff --git a/etc.c b/etc.c @@ -138,11 +138,12 @@ lineSkip(Buffer * buf, Line * line, int offset, int last) Line *l; l = currentLineSkip(buf, line, offset, last); -#ifndef NEXTPAGE_TOPLINE - for (i = (LASTLINE - 1) - (buf->lastLine->linenumber - l->linenumber); - i > 0 && l->prev != NULL; - i--, l = l->prev); +#ifdef NEXTPAGE_TOPLINE + if (! nextpage_topline) #endif + for (i = (LASTLINE - 1) - (buf->lastLine->linenumber - l->linenumber); + i > 0 && l->prev != NULL; + i--, l = l->prev); return l; } diff --git a/fm.h b/fm.h @@ -712,6 +712,9 @@ global int vi_prec_num init(TRUE); #ifdef LABEL_TOPLINE global int label_topline init(FALSE); #endif +#ifdef NEXTPAGE_TOPLINE +global int nextpage_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 @@ -1110,10 +1110,11 @@ nscroll(int n, int mode) tlnum = Currentbuf->topLine->linenumber; llnum = Currentbuf->topLine->linenumber + LASTLINE - 1; #ifdef NEXTPAGE_TOPLINE - diff_n = 0; -#else - diff_n = n - (tlnum - curtop->linenumber); + if (nextpage_topline) + diff_n = 0; + else #endif + diff_n = n - (tlnum - curtop->linenumber); if (lnum < tlnum) lnum = tlnum + diff_n; if (lnum > llnum) diff --git a/rc.c b/rc.c @@ -96,7 +96,10 @@ static int rc_initialized = 0; #define CMT_VI_PREC_NUM "vi風の数値プレフィクス" #endif #ifdef LABEL_TOPLINE -#define CMT_LABEL_TOPLINE "ラベルに移動する時に行頭になるようにする" +#define CMT_LABEL_TOPLINE "ラベルに移動する時にカーソルがトップになるようにする" +#endif +#ifdef NEXTPAGE_TOPLINE +#define CMT_NEXTPAGE_TOPLINE "次のページに移動する時にカーソルがトップになるようにする" #endif #define CMT_SHOW_NUM "行番号を表示する" #define CMT_MIMETYPES "利用するmime.types" @@ -205,6 +208,9 @@ static int rc_initialized = 0; #ifdef LABEL_TOPLINE #define CMT_LABEL_TOPLINE "move cursor to top line when going to label" #endif +#ifdef NEXTPAGE_TOPLINE +#define CMT_NEXTPAGE_TOPLINE "move cursor to top line when moving to next page" +#endif #define CMT_SHOW_NUM "Show line number" #define CMT_MIMETYPES "mime.types files" #define CMT_MAILCAP "mailcap files" @@ -414,6 +420,9 @@ struct param_ptr params3[] = #ifdef LABEL_TOPLINE {"label_topline", P_INT, PI_ONOFF, (void *) &label_topline, CMT_LABEL_TOPLINE, NULL }, #endif +#ifdef NEXTPAGE_TOPLINE + {"nextpage_topline", P_INT, PI_ONOFF, (void *) &nextpage_topline, CMT_NEXTPAGE_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}, #ifdef USE_MOUSE