diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-03-05 18:56:28 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-03-05 18:56:28 +0000 |
commit | 5ef48c8f2ee7b5720195590e12ef8e2463004617 (patch) | |
tree | 23ee2707d4b97bd598375c589a3aa1ed44e43f4a | |
parent | [w3m-dev 03792] URL match string (diff) | |
download | w3m-5ef48c8f2ee7b5720195590e12ef8e2463004617.tar.gz w3m-5ef48c8f2ee7b5720195590e12ef8e2463004617.zip |
[w3m-dev 03793] incremental search fix
main.c (dispincsrch): revert sbuf.pos fix
start from next position in next forward search
(srch): start from next position in forward saerch
if not found, restore original position
(srch_nxtprv): start from next position in next forward search
* search.c (forwardSearch): search from current position
(dispincsrch): start from current position in case of
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | main.c | 15 | ||||
-rw-r--r-- | search.c | 4 |
3 files changed, 26 insertions, 5 deletions
@@ -1,5 +1,15 @@ 2003-03-06 Fumitoshi UKAI <ukai@debian.or.jp> + * [w3m-dev 03793] incremental search fix + * main.c (dispincsrch): revert sbuf.pos fix + start from next position in next forward search + (srch): start from next position in forward saerch + if not found, restore original position + (srch_nxtprv): start from next position in next forward search + * search.c (forwardSearch): search from current position + +2003-03-06 Fumitoshi UKAI <ukai@debian.or.jp> + * [w3m-dev 03792] URL match string incremental search fix * main.c (chkURLBuffer): allow - at end of URL string @@ -7307,4 +7317,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.771 2003/03/05 18:19:12 ukai Exp $ +$Id: ChangeLog,v 1.772 2003/03/05 18:56:28 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.216 2003/03/05 18:19:15 ukai Exp $ */ +/* $Id: main.c,v 1.217 2003/03/05 18:56:28 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -1603,7 +1603,6 @@ dispincsrch(int ch, Str buf, Lineprop *prop) if (ch == 0 && buf == NULL) { SAVE_BUFPOSITION(&sbuf); /* search starting point */ currentLine = sbuf.currentLine; - sbuf.pos -= 1; /* XXX start from current position */ pos = sbuf.pos; return -1; } @@ -1632,12 +1631,16 @@ dispincsrch(int ch, Str buf, Lineprop *prop) if (do_next_search) { if (*str) { + if (searchRoutine == forwardSearch) + Currentbuf->pos += 1; SAVE_BUFPOSITION(&sbuf); srchcore(str, searchRoutine); arrangeCursor(Currentbuf); if (Currentbuf->currentLine == currentLine && Currentbuf->pos == pos) { SAVE_BUFPOSITION(&sbuf); + if (searchRoutine == forwardSearch) + Currentbuf->pos += 1; srchcore(str, searchRoutine); arrangeCursor(Currentbuf); } @@ -1692,6 +1695,7 @@ srch(int (*func) (Buffer *, char *), char *prompt) char *str; int result; int disp = FALSE; + int pos; str = searchKeyData(); if (str == NULL || *str == '\0') { @@ -1704,9 +1708,14 @@ srch(int (*func) (Buffer *, char *), char *prompt) } disp = TRUE; } + pos = Currentbuf->pos; + if (func == forwardSearch) + Currentbuf->pos += 1; result = srchcore(str, func); if (result & SR_FOUND) clear_mark(Currentbuf->currentLine); + else + Currentbuf->pos = pos; displayBuffer(Currentbuf, B_NORMAL); if (disp) disp_srchresult(result, prompt, str); @@ -1759,6 +1768,8 @@ srch_nxtprv(int reverse) reverse = 1; if (searchRoutine == backwardSearch) reverse ^= 1; + if (reverse == 0) + Currentbuf->pos += 1; result = srchcore(SearchString, routine[reverse]); if (result & SR_FOUND) clear_mark(Currentbuf->currentLine); @@ -1,4 +1,4 @@ -/* $Id: search.c,v 1.28 2003/03/05 18:19:17 ukai Exp $ */ +/* $Id: search.c,v 1.29 2003/03/05 18:56:30 ukai Exp $ */ #include "fm.h" #include "regex.h" #include <signal.h> @@ -107,7 +107,7 @@ forwardSearch(Buffer *buf, char *str) if (l == NULL) { return SR_NOTFOUND; } - pos = buf->pos + 1; + pos = buf->pos; if (l->bpos) { pos += l->bpos; while (l->bpos && l->prev) |