diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-10 16:23:52 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-10 16:23:52 +0000 |
commit | b003a875e2c18804f0b3198d954d089a108b8f99 (patch) | |
tree | ef718c86bde07715dd6b86b4f47dff752becc71b /main.c | |
parent | [w3m-dev 03622] Re: Error occured while reset (diff) | |
download | w3m-b003a875e2c18804f0b3198d954d089a108b8f99.tar.gz w3m-b003a875e2c18804f0b3198d954d089a108b8f99.zip |
[w3m-dev 03625] keymap key SEARCH string
* main.c (srch): accept command argument
(reMark): accept command argument
* Bonus/google.cgi: added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.187 2003/01/10 16:08:23 ukai Exp $ */ +/* $Id: main.c,v 1.188 2003/01/10 16:23:59 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -1651,19 +1651,25 @@ srch(int (*func) (Buffer *, char *), char *prompt) { char *str; int result; + int disp = FALSE; - str = inputStrHist(prompt, NULL, TextHist); - if (str != NULL && *str == '\0') - str = SearchString; - if (str == NULL) { - displayBuffer(Currentbuf, B_NORMAL); - return; + str = searchKeyData(); + if (str == NULL || *str == '\0') { + str = inputStrHist(prompt, NULL, TextHist); + if (str != NULL && *str == '\0') + str = SearchString; + if (str == NULL) { + displayBuffer(Currentbuf, B_NORMAL); + return; + } + disp = TRUE; } result = srchcore(str, func); if (result & SR_FOUND) clear_mark(Currentbuf->currentLine); displayBuffer(Currentbuf, B_NORMAL); - disp_srchresult(result, prompt, str); + if (disp) + disp_srchresult(result, prompt, str); searchRoutine = func; } @@ -2634,10 +2640,13 @@ reMark(void) if (!use_mark) return; - str = inputStrHist("(Mark)Regexp: ", MarkString, TextHist); + str = searchKeyData(); if (str == NULL || *str == '\0') { - displayBuffer(Currentbuf, B_NORMAL); - return; + str = inputStrHist("(Mark)Regexp: ", MarkString, TextHist); + if (str == NULL || *str == '\0') { + displayBuffer(Currentbuf, B_NORMAL); + return; + } } if ((p = regexCompile(str, 1)) != NULL) { disp_message(p, TRUE); |