w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 1aab90277f5299083f8291b8a255351c7aaf8135
parent 4937c03b4d6ef20e2603069fe220fe149e7b43e4
Author: ukai <ukai>
Date:   Fri,  8 Nov 2002 16:09:58 +0000

[w3m-dev 03391] use editor when input at last line
* linein.c (_editor): added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>

Diffstat:
MChangeLog | 5+++++
Mlinein.c | 29+++++++++++++++++++++++++++--
2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,10 @@ 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03391] use editor when input at last line + * linein.c (_editor): added + +2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03390] some fixes related with form * form.c (input_textarea): goto input_end unlink(tmpf); diff --git a/linein.c b/linein.c @@ -35,7 +35,7 @@ static int NCFileOffset; static void insertself(char c), _mvR(void), _mvL(void), _mvRw(void), _mvLw(void), delC(void), insC(void), _mvB(void), _mvE(void), _enter(void), _quo(void), _bs(void), _bsw(void), -killn(void), killb(void), _inbrk(void), _esc(void), +killn(void), killb(void), _inbrk(void), _esc(void), _editor(void), _prev(void), _next(void), _compl(void), _tcompl(void), _dcompl(void), _rdcompl(void), _rcompl(void); #ifdef __EMX__ @@ -54,7 +54,7 @@ void (*InputKeymap[32]) () = { /* C-@ C-a C-b C-c C-d C-e C-f C-g */ _compl, _mvB, _mvL, _inbrk, delC, _mvE, _mvR, _inbrk, /* C-h C-i C-j C-k C-l C-m C-n C-o */ - _bs, iself, _enter, killn, iself, _enter, _next, iself, + _bs, iself, _enter, killn, iself, _enter, _next, _editor, /* C-p C-q C-r C-s C-t C-u C-v C-w */ _prev, _quo, _bsw, iself, _mvLw, killb, _quo, _bsw, /* C-x C-y C-z C-[ C-\ C-] C-^ C-_ */ @@ -1125,3 +1125,28 @@ terminated(unsigned char c) return 0; } + +static void +_editor(void) +{ + FormItemList fi; + char *p; + + if (is_passwd) + return; + + fi.readonly = FALSE; + fi.value = Strdup(strBuf); + Strcat_char(fi.value, '\n'); + + input_textarea(&fi); + + strBuf = Strnew(); + for (p = fi.value->ptr; *p; p++) { + if (*p == '\r' || *p == '\n') + continue; + Strcat_char(strBuf, *p); + } + CLen = CPos = setStrType(strBuf, strProp); + displayBuffer(Currentbuf, B_FORCE_REDRAW); +}