commit 2af0d03d1faad8ce14a1f83bce45f6400c7083e4
parent aacf1ba205d264862ddb6b9a0d62d50843db82c8
Author: ukai <ukai>
Date: Wed, 5 Mar 2003 18:19:12 +0000
[w3m-dev 03792] URL match string
incremental search fix
* main.c (chkURLBuffer): allow - at end of URL string
(dispincsrch): start from current position in case of
incremental search
* search.c (forwardSearch): found if same position
(backwardSearch): ditto
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,13 @@
+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
+ (dispincsrch): start from current position in case of
+ incremental search
+ * search.c (forwardSearch): found if same position
+ (backwardSearch): ditto
+
2003-03-03 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03788] UFhalfclose
diff --git a/main.c b/main.c
@@ -1603,6 +1603,7 @@ 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;
}
@@ -4649,7 +4650,7 @@ void
chkURLBuffer(Buffer *buf)
{
static char *url_like_pat[] = {
- "https?://[a-zA-Z0-9][a-zA-Z0-9:%\\-\\./?=~_\\&+@#,\\$;]*[a-zA-Z0-9_/=]",
+ "https?://[a-zA-Z0-9][a-zA-Z0-9:%\\-\\./?=~_\\&+@#,\\$;]*[a-zA-Z0-9_/=\\-]",
"file:/[a-zA-Z0-9:%\\-\\./=_\\+@#,\\$;]*",
#ifdef USE_GOPHER
"gopher://[a-zA-Z0-9][a-zA-Z0-9:%\\-\\./_]*",
diff --git a/search.c b/search.c
@@ -158,9 +158,6 @@ forwardSearch(Buffer *buf, char *str)
continue;
if (regexMatch(l->lineBuf, l->size, 1) == 1) {
matchedPosition(&first, &last);
- if (wrapped && l == begin && buf->pos == first - l->lineBuf)
- /* exactly same match */
- break;
pos = first - l->lineBuf;
while (pos >= l->len && l->next && l->next->bpos) {
pos -= l->len;
@@ -268,13 +265,8 @@ backwardSearch(Buffer *buf, char *str)
q = l->lineBuf;
while (regexMatch(q, &l->lineBuf[l->size] - q, q == l->lineBuf) == 1) {
matchedPosition(&first, &last);
- if (wrapped && l == begin && buf->pos == first - l->lineBuf)
- /* exactly same match */
- ;
- else {
- found = first;
- found_last = last;
- }
+ found = first;
+ found_last = last;
if (q - l->lineBuf >= l->size)
break;
#ifdef JP_CHARSET