aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-30 16:39:29 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-30 16:39:29 +0000
commit0c0438352c1677443670f1348ddc4c014e4a3ffa (patch)
tree5ca48b97eeea65f7b12ab1b21842b60c702f18f2 /file.c
parent[w3m-dev 03717] print newline before exec shell command. (diff)
downloadw3m-0c0438352c1677443670f1348ddc4c014e4a3ffa.tar.gz
w3m-0c0438352c1677443670f1348ddc4c014e4a3ffa.zip
[w3m-dev 03718] Too slow when loading big file with fold_line=1
* etc.c (nextColumn): added (calcPosition): use New_N rewrite with nextColumn (columnLen): added * file.c (addnewline): rewrite with columnLen * proto.h (columnLen): added From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--file.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/file.c b/file.c
index 7a15bb8..1dd350d 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.215 2003/01/30 16:32:00 ukai Exp $ */
+/* $Id: file.c,v 1.216 2003/01/30 16:39:36 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -6128,23 +6128,9 @@ addnewline(Buffer *buf, char *line, Lineprop *prop,
bwidth = 0;
while (1) {
l = buf->currentLine;
- l->width = COLPOS(l, l->len);
l->bpos = bpos;
l->bwidth = bwidth;
- if (l->width <= width)
- return;
- i = columnPos(l, width);
-#ifdef JP_CHARSET
- if (CharType(p[i]) == PC_KANJI2)
- i--;
-#endif
- if (i > 0 && COLPOS(l, i) > width) {
- i--;
-#ifdef JP_CHARSET
- if (CharType(p[i]) == PC_KANJI2)
- i--;
-#endif
- }
+ i = columnLen(l, width);
if (i == 0) {
i++;
#ifdef JP_CHARSET
@@ -6152,10 +6138,10 @@ addnewline(Buffer *buf, char *line, Lineprop *prop,
i++;
#endif
}
- if (i == l->len)
- return;
l->len = i;
l->width = COLPOS(l, l->len);
+ if (pos <= i)
+ return;
bpos += l->len;
bwidth += l->width;
s += i;