diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-29 17:38:12 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-29 17:38:12 +0000 |
commit | 931a54afec82cbbc0eff2f08a3146de2aefe17f6 (patch) | |
tree | f79751e9584c5064fe0de616d543edbafec59e5c | |
parent | [w3m-dev-en 00852] Re: Enhancement: content type detection of files (diff) | |
download | w3m-931a54afec82cbbc0eff2f08a3146de2aefe17f6.tar.gz w3m-931a54afec82cbbc0eff2f08a3146de2aefe17f6.zip |
[w3m-dev 03709] Re: view source, edit source
* display.c (displayBuffer): INIT_BUFFER_WIDTH
* file.c (_saveBuffer): added
(saveBuffer): use _saveBuffer
(saveBufferBody): added
* main.c (vmSrc): saveBufferBody
* proto.h (saveBufferBody): added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | display.c | 12 | ||||
-rw-r--r-- | file.c | 23 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | proto.h | 3 |
5 files changed, 40 insertions, 14 deletions
@@ -1,5 +1,15 @@ 2003-01-30 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03709] Re: view source, edit source + * display.c (displayBuffer): INIT_BUFFER_WIDTH + * file.c (_saveBuffer): added + (saveBuffer): use _saveBuffer + (saveBufferBody): added + * main.c (vmSrc): saveBufferBody + * proto.h (saveBufferBody): added + +2003-01-30 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev-en 00852] Re: Enhancement: content type detection of files * url.c (DefaultGuess): remove upppercases (guessContentTypeFromTable): rewrite, strcasecmp @@ -6937,4 +6947,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.724 2003/01/29 17:33:28 ukai Exp $ +$Id: ChangeLog,v 1.725 2003/01/29 17:38:12 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: display.c,v 1.59 2003/01/29 17:10:27 ukai Exp $ */ +/* $Id: display.c,v 1.60 2003/01/29 17:38:14 ukai Exp $ */ #include <signal.h> #include "fm.h" @@ -360,13 +360,13 @@ displayBuffer(Buffer *buf, int mode) } if (buf->width == 0) - buf->width = COLS; + buf->width = INIT_BUFFER_WIDTH; if (buf->height == 0) buf->height = LASTLINE + 1; - if ((buf->width != INIT_BUFFER_WIDTH && ((buf->type && - !strcmp(buf->type, "text/html")) - || FoldLine)) - || buf->need_reshape) { + if (buf->sourcefile && + ((buf->width != INIT_BUFFER_WIDTH && + ((buf->type && !strcmp(buf->type, "text/html")) || FoldLine)) + || buf->need_reshape)) { buf->need_reshape = TRUE; reshapeBuffer(buf); } @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.212 2003/01/29 17:26:51 ukai Exp $ */ +/* $Id: file.c,v 1.213 2003/01/29 17:38:14 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -6963,10 +6963,9 @@ conv_rule(Line *l) /* * saveBuffer: write buffer to file */ -void -saveBuffer(Buffer *buf, FILE * f, int cont) +static void +_saveBuffer(Buffer *buf, Line *l, FILE * f, int cont) { - Line *l = buf->firstLine; Str tmp; #ifndef KANJI_SYMBOLS @@ -6995,6 +6994,22 @@ saveBuffer(Buffer *buf, FILE * f, int cont) } } +void +saveBuffer(Buffer *buf, FILE * f, int cont) +{ + _saveBuffer(buf, buf->firstLine, f, cont); +} + +void +saveBufferBody(Buffer *buf, FILE * f, int cont) +{ + Line *l = buf->firstLine; + + while (l != NULL && l->real_linenumber == 0) + l = l->next; + _saveBuffer(buf, l, f, cont); +} + static Buffer * loadcmdout(char *cmd, Buffer *(*loadproc) (URLFile *, Buffer *), Buffer *defaultbuf) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.203 2003/01/29 17:10:41 ukai Exp $ */ +/* $Id: main.c,v 1.204 2003/01/29 17:38:15 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -4399,7 +4399,7 @@ vwSrc(void) f = fopen(tmpf->ptr, "w"); if (f == NULL) return; - saveBuffer(Currentbuf, f, TRUE); + saveBufferBody(Currentbuf, f, TRUE); fclose(f); Currentbuf->sourcefile = tmpf->ptr; } @@ -1,4 +1,4 @@ -/* $Id: proto.h,v 1.85 2003/01/29 17:10:51 ukai Exp $ */ +/* $Id: proto.h,v 1.86 2003/01/29 17:38:15 ukai Exp $ */ /* * This file was automatically generated by version 1.7 of cextract. * Manual editing not recommended. @@ -226,6 +226,7 @@ extern Buffer *loadBuffer(URLFile *uf, Buffer *newBuf); extern Buffer *loadImageBuffer(URLFile *uf, Buffer *newBuf); #endif extern void saveBuffer(Buffer *buf, FILE * f, int cont); +extern void saveBufferBody(Buffer *buf, FILE * f, int cont); extern Buffer *getshell(char *cmd); extern Buffer *getpipe(char *cmd); extern Buffer *openPagerBuffer(InputStream stream, Buffer *buf); |