[w3m-dev 02854] highlight for incremental search
* display.c (EFFECT_MARK_START): added
* display.c (EFFECT_MARK_END): added
* display.c (EFFECT_MARK_START_C): added
* display.c (EFFECT_MARK_END_C): added
* display.c (EFFECT_MARK_START_M): added
* display.c (EFFECT_MARK_END_M): added
* display.c: define_effect for MARK_{START,END}
* display.c (mark_mode): added
* display.c (redrawLine): if mark_mode
* display.c (do_effects): do_effect2(PE_MARK, ...)
* display.c (do_effects): do_effect1(PE_MARK, ...)
* fm.h (P_EFFECT): changed to 0x01ff
* fm.h (PE_MARK): moved
* fm.h (mark_color): added
* linein.c (inputLineHistSearch): incrfunc(int ch, Str str)
* main.c (clear_mark): added
* main.c (dispincsrch): remove arg `x', `y'
* main.c (dispincsrch): move SAVE_BUFPOSITION()
* main.c (srch): if (result & SR_FOUND) clear_mark()
* main.c (cmd_mark): PE_MARK
* main.c (nextMk): s/PM_MARK/PE_MARK/
* main.c (prevMk): s/PM_MARK/PE_MARK/
* proto.h (inputLineHistSearch): change prototype incfunc()
* rc.c (CMT_MARK_COLOR): added
* rc.c (params2): add "mark_color"
* search.c (set_mark): added
* search.c (forwardSearch): use set_mark()
* search.c (backwardSearch): use set_mark()
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
21
linein.c
21
linein.c
@@ -1,4 +1,4 @@
|
||||
/* $Id: linein.c,v 1.18 2001/12/25 13:43:51 ukai Exp $ */
|
||||
/* $Id: linein.c,v 1.19 2002/01/16 15:37:06 ukai Exp $ */
|
||||
#include "fm.h"
|
||||
#include "local.h"
|
||||
#include "myctype.h"
|
||||
@@ -82,14 +82,12 @@ static void ins_kanji(Str tmp);
|
||||
|
||||
char *
|
||||
inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
|
||||
int (*incrfunc) (int ch, Str str, short *x, short *y))
|
||||
int (*incrfunc) (int ch, Str str))
|
||||
{
|
||||
int opos, x, y, lpos, rpos, epos;
|
||||
unsigned char c;
|
||||
char *p;
|
||||
Lineprop mode;
|
||||
short cursorX = -1;
|
||||
short cursorY = -1;
|
||||
#ifdef JP_CHARSET
|
||||
Str tmp = Strnew();
|
||||
#endif /* JP_CHARSET */
|
||||
@@ -170,10 +168,7 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
|
||||
else
|
||||
addStr(strBuf->ptr, strProp, CLen, offset, COLS - opos);
|
||||
clrtoeolx();
|
||||
if (cursorX >= 0 && cursorY >= 0)
|
||||
move(cursorY, cursorX);
|
||||
else
|
||||
move(LASTLINE, opos + x - offset);
|
||||
move(LASTLINE, opos + x - offset);
|
||||
refresh();
|
||||
|
||||
next_char:
|
||||
@@ -197,7 +192,7 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
|
||||
InnerCode);
|
||||
ins_kanji(tmp);
|
||||
if (incrfunc)
|
||||
incrfunc(-1, strBuf, &cursorX, &cursorY);
|
||||
incrfunc(-1, strBuf);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -235,10 +230,10 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
|
||||
}
|
||||
else if (!i_quote && c < 0x20) { /* Control code */
|
||||
if (incrfunc == NULL
|
||||
|| (c = incrfunc((int)c, strBuf, &cursorX, &cursorY)) < 0x20)
|
||||
|| (c = incrfunc((int)c, strBuf)) < 0x20)
|
||||
(*InputKeymap[(int)c]) (c);
|
||||
if (incrfunc)
|
||||
incrfunc(-1, strBuf, &cursorX, &cursorY);
|
||||
incrfunc(-1, strBuf);
|
||||
if (cm_clear)
|
||||
cm_next = FALSE;
|
||||
if (cm_disp_clear)
|
||||
@@ -255,7 +250,7 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
|
||||
tmp = conv_str(tmp, DisplayCode, InnerCode);
|
||||
ins_kanji(tmp);
|
||||
if (incrfunc)
|
||||
incrfunc(-1, strBuf, &cursorX, &cursorY);
|
||||
incrfunc(-1, strBuf);
|
||||
}
|
||||
else if ((c & 0x80) || in_kanji) { /* Kanji 1 */
|
||||
i_quote = FALSE;
|
||||
@@ -284,7 +279,7 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
|
||||
CPos++;
|
||||
mode = PC_ASCII;
|
||||
if (incrfunc)
|
||||
incrfunc(-1, strBuf, &cursorX, &cursorY);
|
||||
incrfunc(-1, strBuf);
|
||||
}
|
||||
if (CLen && (flag & IN_CHAR))
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user