From: Chris Allegretta Date: Fri, 17 Aug 2001 00:03:46 +0000 (+0000) Subject: Add and fix bugs #63 and 64 X-Git-Tag: v1.0.4~2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e060e1c87a455e0d0b4c595a62fed939eb63c7e3;p=nano.git Add and fix bugs #63 and 64 git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_1_0_branch/nano@744 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/BUGS b/BUGS index 0e734079..86756050 100644 --- a/BUGS +++ b/BUGS @@ -117,6 +117,12 @@ - Blank lines are not kept when cutting with -k (discovered by Rocco) (61) [FIXED]. - Nano will not suspend properly inside of mutt (62) [FIXED]. +- When switching from Pico mode to normal mode, the previous search is + not displayed until cancelling the search (63) [FIXED]. +- If you change search options but don't change the search string in + normal mode, hitting enter causes the search/replace to abort (64) + (Jordi Mallach) [FIXED]. + ** Open BUGS ** $Id$ diff --git a/ChangeLog b/ChangeLog index f492f713..1b477320 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ CVS code - +- General + - Added BUGS #63 & 64. Fixes in search_init() and nanogetstr(), + new flag CLEAR_BACKUPSTRING because there's no easy way to + clear the backupstring without making it global (messy), so we + use a flag instead (just as messy?) - files.c: do_browser() - More Picoish keystrokes for the browser, ^P, ^N, etc, for up, diff --git a/aclocal.m4 b/aclocal.m4 index efced845..be6cea67 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 +dnl aclocal.m4 generated automatically by aclocal 1.4-p4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/config.h.in b/config.h.in index 0bb4b94d..44792244 100644 --- a/config.h.in +++ b/config.h.in @@ -1,4 +1,4 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ +/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if using alloca.c. */ #undef C_ALLOCA diff --git a/nano.c b/nano.c index bfe3e024..1802cff5 100644 --- a/nano.c +++ b/nano.c @@ -2116,6 +2116,7 @@ void do_toggle(int which) switch (toggles[which].val) { case TOGGLE_PICOMODE_KEY: shortcut_init(0); + SET(CLEAR_BACKUPSTRING); display_main_list(); break; case TOGGLE_SUSPEND_KEY: diff --git a/nano.h b/nano.h index 31b1c16e..c314943b 100644 --- a/nano.h +++ b/nano.h @@ -111,6 +111,9 @@ typedef struct toggle { #define TEMP_OPT (1<<16) #define CUT_TO_END (1<<17) #define DISABLE_CURPOS (1<<18) +/* 19, 20 in nano-1.1 */ +#define CLEAR_BACKUPSTRING (1<<21) + /* Control key sequences, changing these would be very very bad */ diff --git a/search.c b/search.c index 42d8ae9a..d84311db 100644 --- a/search.c +++ b/search.c @@ -82,6 +82,14 @@ int search_init(int replacing) buf = nmalloc(strlen(last_search) + 5); buf[0] = 0; + + /* Clear the backupstring if we've changed from Pico mode to regular + mode */ + if (ISSET(CLEAR_BACKUPSTRING)) { + free(backupstring); + backupstring = NULL; + } + /* 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 diff --git a/winio.c b/winio.c index 56e52a81..706db27f 100644 --- a/winio.c +++ b/winio.c @@ -454,10 +454,8 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen, answer = mallocstrcpy(answer, inputbuf); free(inputbuf); - /* Now that the text is editable instead of bracketed, we have to - check for answer == def, instead of answer == "" */ - if (((ISSET(PICO_MODE)) && !strcmp(answer, "")) || - ((!ISSET(PICO_MODE)) && !strcmp(answer, def))) + /* In pico mode, just check for a blank answer here */ + if (((ISSET(PICO_MODE)) && !strcmp(answer, ""))) return -2; else return 0;