aboutsummaryrefslogtreecommitdiffstats
path: root/buffer.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-23 18:37:18 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-23 18:37:18 +0000
commit61c2c2de18d3ef19c321bac335043424c862aba7 (patch)
tree52b5d72b1c3298f7e12b72daabfff2b37eb37680 /buffer.c
parent* etc.c (next_status): after = is R_ST_VALUE (diff)
downloadw3m-61c2c2de18d3ef19c321bac335043424c862aba7.tar.gz
w3m-61c2c2de18d3ef19c321bac335043424c862aba7.zip
[w3m-dev 03667] fold patch
* anchor.c (reAnchorPos): rewrite (reAnchorWord): delete reseq_anchor() (reAnchorAny): use l->size delete reseq_anchor() * backend.c (internal_get): pass TRUE to saveBuffer * buffer.c (newBuffer): delete n->linelen (reshapeBuffer): rewrite * display.c (displayBuffer): FoldLine (redrawLine): l->bpos (cursorUp0): added (cursorUp): rewrite (cursorDown0): added (cursowDown): rewrite (cursorRight): check l->next l->bwidth (cursorLeft): l->prev && l->bpos l->bwidth (arrangeCursor): buf->currentLine->bwidth buf->cursorX * etc.c (checkType): **oporp rewrite (calcPosition): realColumn allocated by New_reuse * file.c (addnewline): add nlines arg (propBuffer): deleted (colorBuffer): deleted (readHeader): propBuffer FOLD_BUFFER_WIDTH (HTMLlineproc2body): rewrite (addnewline2): added (addnewline): rewrite (loadBuffer): propBuffer, colorBuffer (saveBuffer): cont arg (getNextPage): rewrite * fm.h (LINELEN): 256 (FNLEN): deleted (Line): add size, bpos, bwidth (Buffer): delete linelen (INIT_BUFFER_WIDTH): check showLineNum (FOLD_BUFFER_WIDTH): added (FoldLine): added * funcname.tab (RESHAPE): added * main.c (do_dump): pass FALSE to saveBuffer (nscroll): rewrite (clear_mark): l->size (shiftvisualpos): rewrite (pipeBuf): pass TRUE to saveBuffer (linebeg): check line->prev && line->bpos (linend): check line->next, line->next->bpos (editScr): pass TRUE to saveBuffer (svBuf): pass TRUE to saveBuffer (vmSrc): pass TRUE to saveBuffer (reshape): added (curlno): rewrite * mimehead.c (LINELEN): deleted * proto.h (reshape): added (saveBuffer): add cont arg (cursorUp0): added (cursorDown0): added (checkType): change type oprop, ocolor, delete check_color, len * rc.c (CMT_FOLD_LINE): added (params1): add fold_line (sync_with_option): check PagerMax * search.c (set_mark): l->size (forwardSearch): rewrite (backwardSearch): rewrite * doc/README.func (RESHAPE): added * doc-jp/README.func (RESHAPE): added * scripts/w3mhelp.cgi.in (Buffer operation): add reshape From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/buffer.c b/buffer.c
index 4fbb4fe..ab4f64e 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1,4 +1,4 @@
-/* $Id: buffer.c,v 1.19 2003/01/22 16:16:19 ukai Exp $ */
+/* $Id: buffer.c,v 1.20 2003/01/23 18:37:20 ukai Exp $ */
#include "fm.h"
#ifdef USE_MOUSE
@@ -40,7 +40,6 @@ newBuffer(int width)
n->bufferprop = BP_NORMAL;
n->clone = New(int);
*n->clone = 1;
- n->linelen = 0;
n->trbyte = 0;
#ifdef USE_SSL
n->ssl_certificate = NULL;
@@ -558,8 +557,19 @@ reshapeBuffer(Buffer *buf)
#endif
buf->height = LASTLINE + 1;
- if (buf->firstLine)
- restorePosition(buf, &sbuf);
+ if (buf->firstLine && sbuf.firstLine) {
+ int n;
+ gotoRealLine(buf, sbuf.currentLine->real_linenumber);
+ n = (buf->currentLine->linenumber - buf->topLine->linenumber)
+ - (sbuf.currentLine->linenumber - sbuf.topLine->linenumber);
+ if (n) {
+ buf->topLine = lineSkip(buf, buf->topLine, n, FALSE);
+ gotoRealLine(buf, sbuf.currentLine->real_linenumber);
+ }
+ buf->pos = sbuf.pos;
+ buf->currentColumn = sbuf.currentColumn;
+ arrangeCursor(buf);
+ }
if (buf->check_url & CHK_URL)
chkURLBuffer(buf);
#ifdef USE_NNTP