diff options
Diffstat (limited to '')
-rw-r--r-- | buffer.c | 31 |
1 files changed, 8 insertions, 23 deletions
@@ -1,4 +1,4 @@ -/* $Id: buffer.c,v 1.8 2001/12/04 16:33:08 ukai Exp $ */ +/* $Id: buffer.c,v 1.9 2001/12/26 18:17:57 ukai Exp $ */ #include "fm.h" #ifdef USE_MOUSE @@ -487,8 +487,7 @@ void reshapeBuffer(Buffer *buf) { URLFile f; - int top, linenum, cursorY, pos, currentColumn; - AnchorList *formitem; + Buffer sbuf; if (buf->sourcefile == NULL) return; @@ -498,24 +497,13 @@ reshapeBuffer(Buffer *buf) if (f.stream == NULL) return; - if (buf->firstLine == NULL) { - top = 1; - linenum = 1; - } - else { - top = buf->topLine->linenumber; - linenum = buf->currentLine->linenumber; - } - cursorY = buf->cursorY; - pos = buf->pos; - currentColumn = buf->currentColumn; + copyBuffer(&sbuf, buf); clearBuffer(buf); while (buf->frameset) { deleteFrameSet(buf->frameset); buf->frameset = popFrameTree(&(buf->frameQ)); } - formitem = buf->formitem; buf->href = NULL; buf->name = NULL; buf->img = NULL; @@ -537,18 +525,15 @@ reshapeBuffer(Buffer *buf) #endif buf->height = LASTLINE + 1; - buf->topLine = lineSkip(buf, buf->topLine, top - 1, FALSE); - gotoLine(buf, linenum); - buf->pos = pos; - buf->currentColumn = currentColumn; - arrangeCursor(buf); + if (buf->firstLine) + restorePosition(buf, &sbuf); if (buf->check_url & CHK_URL) - chkURL(); + chkURLBuffer(buf); #ifdef USE_NNTP if (buf->check_url & CHK_NMID) - chkNMID(); + chkNMIDBuffer(buf); #endif - formResetBuffer(buf, formitem); + formResetBuffer(buf, sbuf.formitem); } /* shallow copy */ |