From 885e5cad27e126f6761eefd0d460e0b374d2e4d1 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Fri, 8 Nov 2002 15:54:46 +0000 Subject: [w3m-dev 03387] Re: tab browser * buffer.c (newBuffer): buf->LINES initialize (gotoLine): use buf->LINES (gotoRealLine): use buf->LINES * display.c (displayBuffer): check by buf->LINES (redrawNLine): buf->LINES (redrawLine): buf->LINES (redrawLineImage): no need buf->rootY (cursorDown): buf->LINES (arrangeCursor): buf->LINES * etc.c (columnSkip): buf->LINES (lineSkip): buf->LINES (currentLineSkip): buf->LINES * fm.h (Buffer): add LINES * main.c (nscroll): Currentbuf->LINES (pgFore): Currentbuf->LINES (pgBack): Currentbuf->LINES (ctrCsrV): Currentbuf->LINES (movD): Currentbuf->LINES (movU): Currentbuf->LINES (_goLine): Currentbuf->LINES (drawAnchorCursor): Currentbuf->LINES (setOpt): B_REDRAW_IMAGE (newT): B_REDRAW_IMAGE (closeT): B_REDRAW_IMAGE (nextT): B_REDRAW_IMAGE (prevT): B_REDRAW_IMAGE (moveTab): B_NORMAL From: Hironori SAKAMOTO --- buffer.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index 2f45355..5c5b246 100644 --- a/buffer.c +++ b/buffer.c @@ -1,4 +1,4 @@ -/* $Id: buffer.c,v 1.13 2002/03/15 19:02:40 ukai Exp $ */ +/* $Id: buffer.c,v 1.14 2002/11/08 15:54:46 ukai Exp $ */ #include "fm.h" #ifdef USE_MOUSE @@ -32,6 +32,7 @@ newBuffer(int width) bzero((void *)n, sizeof(Buffer)); n->width = width; n->COLS = COLS; + n->LINES = LASTLINE; n->currentURL.scheme = SCM_UNKNOWN; n->baseURL = NULL; n->baseTarget = NULL; @@ -252,15 +253,16 @@ gotoLine(Buffer *buf, int n) sprintf(msg, "Last line is #%ld", buf->lastLine->linenumber); set_delayed_message(msg); buf->currentLine = l; - buf->topLine = lineSkip(buf, buf->currentLine, -(LASTLINE - 1), FALSE); + buf->topLine = lineSkip(buf, buf->currentLine, -(buf->LINES - 1), + FALSE); return; } for (; l != NULL; l = l->next) { if (l->linenumber >= n) { buf->currentLine = l; if (n < buf->topLine->linenumber || - buf->topLine->linenumber + LASTLINE <= n) - buf->topLine = lineSkip(buf, l, -(LASTLINE + 1) / 2, FALSE); + buf->topLine->linenumber + buf->LINES <= n) + buf->topLine = lineSkip(buf, l, -(buf->LINES + 1) / 2, FALSE); break; } } @@ -294,15 +296,16 @@ gotoRealLine(Buffer *buf, int n) sprintf(msg, "Last line is #%ld", buf->lastLine->real_linenumber); set_delayed_message(msg); buf->currentLine = l; - buf->topLine = lineSkip(buf, buf->currentLine, -(LASTLINE - 1), FALSE); + buf->topLine = lineSkip(buf, buf->currentLine, -(buf->LINES - 1), + FALSE); return; } for (; l != NULL; l = l->next) { if (l->real_linenumber >= n) { buf->currentLine = l; if (n < buf->topLine->real_linenumber || - buf->topLine->real_linenumber + LASTLINE <= n) - buf->topLine = lineSkip(buf, l, -(LASTLINE + 1) / 2, FALSE); + buf->topLine->real_linenumber + buf->LINES <= n) + buf->topLine = lineSkip(buf, l, -(buf->LINES + 1) / 2, FALSE); break; } } -- cgit v1.2.3