[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 <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
17
buffer.c
17
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user