diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-12-26 18:17:57 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-12-26 18:17:57 +0000 |
commit | 91f74e09ec828e73037d094b3e4063601ebb7ce2 (patch) | |
tree | 20539d8e870b2525475e49402d0a56feaeb87125 /buffer.c | |
parent | [w3m-dev 02735] (diff) | |
download | w3m-91f74e09ec828e73037d094b3e4063601ebb7ce2.tar.gz w3m-91f74e09ec828e73037d094b3e4063601ebb7ce2.zip |
[w3m-dev 02748] cleanup code for restoring cursor position
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
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 */ |