aboutsummaryrefslogtreecommitdiffstats
path: root/buffer.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-24 17:30:38 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-24 17:30:38 +0000
commit7a5aebe4b08cffaaf49a46bcf6730eed052491f5 (patch)
tree5d4d08e10b122e77dd7fb606625c9257bd6d756d /buffer.c
parentNEWS: func: RESHAPE (diff)
downloadw3m-7a5aebe4b08cffaaf49a46bcf6730eed052491f5.tar.gz
w3m-7a5aebe4b08cffaaf49a46bcf6730eed052491f5.zip
[w3m-dev 03681] Re: fold patch
* buffer.c (reshapeBuffer): buf->pos, sbuf.currentLine fix FoldLine * display.c (arrangeCursor): buf->pos fix (restorePosition): buf->pos fix From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/buffer.c b/buffer.c
index bb6423f..de1908f 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1,4 +1,4 @@
-/* $Id: buffer.c,v 1.21 2003/01/23 18:38:04 ukai Exp $ */
+/* $Id: buffer.c,v 1.22 2003/01/24 17:30:50 ukai Exp $ */
#include "fm.h"
#ifdef USE_MOUSE
@@ -559,6 +559,11 @@ reshapeBuffer(Buffer *buf)
buf->height = LASTLINE + 1;
if (buf->firstLine && sbuf.firstLine) {
int n;
+ buf->pos = sbuf.pos;
+ if (sbuf.currentLine)
+ buf->pos += sbuf.currentLine->bpos;
+ while (sbuf.currentLine->bpos && sbuf.currentLine->prev)
+ sbuf.currentLine = sbuf.currentLine->prev;
gotoRealLine(buf, sbuf.currentLine->real_linenumber);
n = (buf->currentLine->linenumber - buf->topLine->linenumber)
- (sbuf.currentLine->linenumber - sbuf.topLine->linenumber);
@@ -566,8 +571,10 @@ reshapeBuffer(Buffer *buf)
buf->topLine = lineSkip(buf, buf->topLine, n, FALSE);
gotoRealLine(buf, sbuf.currentLine->real_linenumber);
}
- buf->pos = sbuf.pos;
- buf->currentColumn = sbuf.currentColumn;
+ if (FoldLine)
+ buf->currentColumn = 0;
+ else
+ buf->currentColumn = sbuf.currentColumn;
arrangeCursor(buf);
}
if (buf->check_url & CHK_URL)