diff --git a/BUGS b/BUGS index 8bd13b503b89371645052cd1255ec931b55db2a8..a3412e8ae960c8843f9a678f467beeead218258a 100644 --- a/BUGS +++ b/BUGS @@ -99,6 +99,8 @@ higuita@cadernoverde.com) (54) [FIXED]. - When using autoindent (-i), wrapped text does not get auto-indented (55, discovered by Mark Senior) [FIXED]. +- When using -R (regex) and -p (pico mode), subsequent searches after + the first fail if no string is entered (56) [FIXED]. ** Open BUGS ** diff --git a/ChangeLog b/ChangeLog index 71d5dc2ffe7b5779ce5fd37e91998fe52693d14d..1b5565ae1784f7e31a056a36559951148e22af97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,11 @@ CVS code - - Added SAMELINE case to above. Added checks to cases 1b and 2b for placement of cursor. - search.c: + print_replaced() - s/occurence/occurrence typos (Jordi). + search_init() + - If using Pico mode and regex and same answer is entered, use + last_search string instead of answer (fixes BUG #56). - nano.texi: - Meta-Z correction and grammar in --enable-tiny desc (Neil Parks). diff --git a/search.c b/search.c index fb59b523f37a767915814abac103a7df70c255d8..041e7740cf73fa179ab766e42ae0554963cb2a45 100644 --- a/search.c +++ b/search.c @@ -81,7 +81,6 @@ int search_init(int replacing) buf = nmalloc(strlen(last_search) + 5); buf[0] = 0; - /* Okay, fun time. backupstring is our holder for what is being returned from the statusq call. Using answer for this would be tricky. Here, if we're using PICO_MODE, we only want nano to put the @@ -140,8 +139,14 @@ int search_init(int replacing) return -1; } else if (i == -2) { /* Same string */ #ifdef HAVE_REGEX_H - if (ISSET(USE_REGEXP)) - regexp_init(answer); + if (ISSET(USE_REGEXP)) { + + /* If we're in pico mode, answer is "", use last_search! */ + if (ISSET(PICO_MODE)) + regexp_init(last_search); + else + regexp_init(answer); + } #else ; #endif