Add and fix bugs #63 and 64

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@744 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2001-08-17 00:03:46 +00:00
parent 372b1a0939
commit c1049aced1
7 changed files with 26 additions and 20 deletions

6
BUGS
View File

@ -117,7 +117,11 @@
- 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 **

View File

@ -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?)
- nano.texi:
-corrected the Mouse Toggle section, noticed by Daniel Bonniot.

1
nano.c
View File

@ -2274,6 +2274,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:

1
nano.h
View File

@ -140,6 +140,7 @@ typedef struct rcoption {
#define DISABLE_CURPOS (1<<18)
#define REVERSE_SEARCH (1<<19)
#define MULTIBUFFER (1<<20)
#define CLEAR_BACKUPSTRING (1<<21)
/* Control key sequences, changing these would be very very bad */

View File

@ -258,7 +258,7 @@ following toggles are available:
`Cut To End Toggle (Meta-K)'
toggles the -k (-cut) command line flag.
`Cut To End Toggle (Meta-M)'
`Mouse Toggle (Meta-M)'
toggles the -m (-mouse) command line flag.
`Pico Mode Toggle (Meta-P)'
@ -404,8 +404,8 @@ Node: The Statusbar6367
Node: Shortcut Lists6948
Node: Online Help7341
Node: Feature Toggles7717
Node: The File Browser8860
Node: Pico Compatibility9569
Node: Building and Configure Options11611
Node: The File Browser8855
Node: Pico Compatibility9564
Node: Building and Configure Options11606

End Tag Table

View File

@ -85,6 +85,14 @@ int search_init(int replacing)
buf = charalloc(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
@ -183,17 +191,6 @@ int search_init(int replacing)
case NANO_OTHERSEARCH_KEY:
backupstring = mallocstrcpy(backupstring, answer);
return -2; /* Call the opposite search function */
/*
} else if (i == NANO_REVERSESEARCH_KEY) {
free(backupstring);
backupstring = NULL;
backupstring = mallocstrcpy(backupstring, answer);
TOGGLE(REVERSE_SEARCH);
return 1;
} else if (i == NANO_FROMSEARCHTOGOTO_KEY) {
*/
case NANO_FROMSEARCHTOGOTO_KEY:
free(backupstring);
backupstring = NULL;

View File

@ -499,10 +499,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;