From 105da33276410cbcd9cacd526bb95f945115955e Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Tue, 31 Oct 2000 05:10:10 +0000 Subject: [PATCH] Made previous s/r values editable text git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@250 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 13 ++- global.c | 16 +++- nano.h | 3 +- po/cat-id-tbl.c | 48 ++++++----- po/es.gmo | Bin 17332 -> 17459 bytes po/nano.pot | 211 +++++++++++++++++++++++------------------------- proto.h | 2 +- search.c | 41 ++++------ winio.c | 5 +- 9 files changed, 168 insertions(+), 171 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5417f527..5bf348d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,13 @@ CVS Code - - Ran source through indent -kr again. Make everything pretty. -- Added "replace with null" option. ^N in replace. New alias - NANO_NULL_KEY, and code in do_replace to check for it. Readded - NANO_NULL_KEY case to search_init code. +- Changed behavior of "search" and "replace" prompts to make all + previous values editable. This change was made so that you can + replace with the null string without needing a special key for it. + changed code in search_init(), do_replace(), nanogetstr (see below). - global.c + - New global replace_list_2, for 2nd half of the replace dialog + ("Replace with:"), has fewer options than first half because + they were inapropriate. toggle_init() - Added #ifdef around toggle_regex_msg to get rid of compiler warning. @@ -23,12 +27,15 @@ CVS Code - - Removed redundant code involving processing replacemenet string. Converted if statements to switch statements. - Optimizations by Rocco Corsi. + - Removed code for deleted shortcuts from in replace_list_2. do_search() - Converted if statements to one switch statement. - winio.c nanogetstr() - Added check for 343 in while loop to get rid of getting "locked" into statusbar" bug in odd $TERMs like iris-ansi. + - Changed check to return -2 on "enter" from answer == "" + to answer == def. nanoget_repaint() - New function, removes about 30 lines of duplicate code in nanogetstr(). diff --git a/global.c b/global.c index a0d8e527..55fa17cd 100644 --- a/global.c +++ b/global.c @@ -74,6 +74,7 @@ int mark_beginx; /* X value in the string to start */ shortcut main_list[MAIN_LIST_LEN]; shortcut whereis_list[WHEREIS_LIST_LEN]; shortcut replace_list[REPLACE_LIST_LEN]; +shortcut replace_list_2[REPLACE_LIST_LEN]; /* 2nd half of replace dialog */ shortcut goto_list[GOTO_LIST_LEN]; shortcut writefile_list[WRITEFILE_LIST_LEN]; shortcut help_list[HELP_LIST_LEN]; @@ -361,10 +362,21 @@ void shortcut_init(void) _("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW, do_gotoline_void); - sc_init_one(&replace_list[5], NANO_NULL_KEY, _("Null Str"), + sc_init_one(&replace_list[5], NANO_CANCEL_KEY, _("Cancel"), + nano_cancel_msg, 0, 0, 0, VIEW, 0); + + + + sc_init_one(&replace_list_2[0], NANO_FIRSTLINE_KEY, _("First Line"), + nano_firstline_msg, 0, 0, 0, VIEW, do_first_line); + + sc_init_one(&replace_list_2[1], NANO_LASTLINE_KEY, _("Last Line"), + nano_lastline_msg, 0, 0, 0, VIEW, do_last_line); + + sc_init_one(&replace_list_2[2], NANO_NULL_KEY, _("Null Str"), nano_null_msg, 0, 0, 0, VIEW, 0); - sc_init_one(&replace_list[6], NANO_CANCEL_KEY, _("Cancel"), + sc_init_one(&replace_list_2[3], NANO_CANCEL_KEY, _("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0); diff --git a/nano.h b/nano.h index 452f06d7..2acba78a 100644 --- a/nano.h +++ b/nano.h @@ -240,7 +240,8 @@ know what you're doing */ #define MAIN_LIST_LEN 26 #define MAIN_VISIBLE 12 #define WHEREIS_LIST_LEN 6 -#define REPLACE_LIST_LEN 7 +#define REPLACE_LIST_LEN 6 +#define REPLACE_LIST_2_LEN 4 #define GOTO_LIST_LEN 3 #define WRITEFILE_LIST_LEN 1 #define HELP_LIST_LEN 3 diff --git a/po/cat-id-tbl.c b/po/cat-id-tbl.c index 584c4497..2a5cb068 100644 --- a/po/cat-id-tbl.c +++ b/po/cat-id-tbl.c @@ -209,30 +209,28 @@ Usage: nano [option] +LINE \n\ {"Replaced %d occurences", 176}, {"Replaced 1 occurence", 177}, {"Replace Cancelled", 178}, - {"Nothing Happens", 179}, - {"Replace with [%s]", 180}, - {"Replace with", 181}, - {"Replace this instance?", 182}, - {"Enter line number", 183}, - {"Aborted", 184}, - {"Come on, be reasonable", 185}, - {"Only %d lines available, skipping to last line", 186}, - {"actual_x_from_start for xplus=%d returned %d\n", 187}, - {"input '%c' (%d)\n", 188}, - {"New Buffer", 189}, - {" File: ...", 190}, - {"Modified", 191}, - {"Moved to (%d, %d) in edit buffer\n", 192}, - {"current->data = \"%s\"\n", 193}, - {"I got \"%s\"\n", 194}, - {"Yes", 195}, - {"All", 196}, - {"No", 197}, - {"do_cursorpos: linepct = %f, bytepct = %f\n", 198}, - {"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 199}, - {"Dumping file buffer to stderr...\n", 200}, - {"Dumping cutbuffer to stderr...\n", 201}, - {"Dumping a buffer to stderr...\n", 202}, + {"Replace with", 179}, + {"Replace this instance?", 180}, + {"Enter line number", 181}, + {"Aborted", 182}, + {"Come on, be reasonable", 183}, + {"Only %d lines available, skipping to last line", 184}, + {"actual_x_from_start for xplus=%d returned %d\n", 185}, + {"input '%c' (%d)\n", 186}, + {"New Buffer", 187}, + {" File: ...", 188}, + {"Modified", 189}, + {"Moved to (%d, %d) in edit buffer\n", 190}, + {"current->data = \"%s\"\n", 191}, + {"I got \"%s\"\n", 192}, + {"Yes", 193}, + {"All", 194}, + {"No", 195}, + {"do_cursorpos: linepct = %f, bytepct = %f\n", 196}, + {"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 197}, + {"Dumping file buffer to stderr...\n", 198}, + {"Dumping cutbuffer to stderr...\n", 199}, + {"Dumping a buffer to stderr...\n", 200}, }; -int _msg_tbl_length = 202; +int _msg_tbl_length = 200; diff --git a/po/es.gmo b/po/es.gmo index 4c41b7d7e6986cf452cb494f92c8139e0cad0425..25441f656147ff9502c12e3ebf3cb9d1eb6bbe1b 100644 GIT binary patch delta 4417 zcmZA2c~DkW9LDh_E4m*n(gdh)){wUJ3N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}4N7!!$l ztj_KtItCHFZS*SBv53qh%g9`^j%cUpc$~aJ^o;2!C6AFR^{z2_lIRGK!K9G9PP8mu zqT^2TR__pIq`}s&%2V^p7Nt%;#GJxC>+#M7iCOTG;ZKOUKPd1YGiHGRD zdKZ~ZbPOb`$v)DK=(wG9CwkCpj*&G59O23fa5uR}>pz3EAk)ZRvYzO;muwA|_46wy($&s6S99??VgCWSua0J)DmKwcv?$E_4zBt`DT v5@&i~YuwoQKvK(}!UOeM<%HMv`aE85j;~8#VCy-Ffv@x8BLX*iWQYF`u+O4% diff --git a/po/nano.pot b/po/nano.pot index 06dc2e3d..15fa3917 100644 --- a/po/nano.pot +++ b/po/nano.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-10-27 01:45-0400\n" +"POT-Creation-Date: 2000-10-31 00:04-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -107,292 +107,292 @@ msgstr "" msgid "File exists, OVERWRITE ?" msgstr "" -#: global.c:123 +#: global.c:124 msgid "Constant cursor position" msgstr "" -#: global.c:124 +#: global.c:125 msgid "Auto indent" msgstr "" -#: global.c:125 +#: global.c:126 msgid "Suspend" msgstr "" -#: global.c:126 +#: global.c:127 msgid "Help mode" msgstr "" -#: global.c:127 +#: global.c:128 msgid "Pico messages" msgstr "" -#: global.c:128 +#: global.c:129 msgid "Mouse support" msgstr "" -#: global.c:129 +#: global.c:130 msgid "Cut to end" msgstr "" -#: global.c:131 +#: global.c:132 msgid "Regular expressions" msgstr "" -#: global.c:133 +#: global.c:134 msgid "Auto wrap" msgstr "" -#: global.c:175 +#: global.c:176 msgid "Invoke the help menu" msgstr "" -#: global.c:176 +#: global.c:177 msgid "Write the current file to disk" msgstr "" -#: global.c:177 +#: global.c:178 msgid "Exit from nano" msgstr "" -#: global.c:178 +#: global.c:179 msgid "Goto a specific line number" msgstr "" -#: global.c:179 +#: global.c:180 msgid "Justify the current paragraph" msgstr "" -#: global.c:180 +#: global.c:181 msgid "Replace text within the editor" msgstr "" -#: global.c:181 +#: global.c:182 msgid "Insert another file into the current one" msgstr "" -#: global.c:182 +#: global.c:183 msgid "Search for text within the editor" msgstr "" -#: global.c:183 +#: global.c:184 msgid "Move to the previous screen" msgstr "" -#: global.c:184 +#: global.c:185 msgid "Move to the next screen" msgstr "" -#: global.c:185 +#: global.c:186 msgid "Cut the current line and store it in the cutbuffer" msgstr "" -#: global.c:186 +#: global.c:187 msgid "Uncut from the cutbuffer into the current line" msgstr "" -#: global.c:187 +#: global.c:188 msgid "Show the posititon of the cursor" msgstr "" -#: global.c:188 +#: global.c:189 msgid "Invoke the spell checker (if available)" msgstr "" -#: global.c:189 +#: global.c:190 msgid "Move up one line" msgstr "" -#: global.c:190 +#: global.c:191 msgid "Move down one line" msgstr "" -#: global.c:191 +#: global.c:192 msgid "Move forward one character" msgstr "" -#: global.c:192 +#: global.c:193 msgid "Move back one character" msgstr "" -#: global.c:193 +#: global.c:194 msgid "Move to the beginning of the current line" msgstr "" -#: global.c:194 +#: global.c:195 msgid "Move to the end of the current line" msgstr "" -#: global.c:195 +#: global.c:196 msgid "Go to the first line of the file" msgstr "" -#: global.c:196 +#: global.c:197 msgid "Go to the last line of the file" msgstr "" -#: global.c:197 +#: global.c:198 msgid "Refresh (redraw) the current screen" msgstr "" -#: global.c:198 +#: global.c:199 msgid "Mark text at the current cursor location" msgstr "" -#: global.c:199 +#: global.c:200 msgid "Delete the character under the cursor" msgstr "" -#: global.c:201 +#: global.c:202 msgid "Delete the character to the left of the cursor" msgstr "" -#: global.c:202 +#: global.c:203 msgid "Insert a tab character" msgstr "" -#: global.c:203 +#: global.c:204 msgid "Insert a carriage return at the cursor position" msgstr "" -#: global.c:205 +#: global.c:206 msgid "Make the current search or replace case (in)sensitive" msgstr "" -#: global.c:206 +#: global.c:207 msgid "Cancel the current function" msgstr "" -#: global.c:207 +#: global.c:208 msgid "Use the null string, \"\"" msgstr "" -#: global.c:211 global.c:323 global.c:400 +#: global.c:212 global.c:324 global.c:412 msgid "Get Help" msgstr "" -#: global.c:214 global.c:222 +#: global.c:215 global.c:223 msgid "WriteOut" msgstr "" -#: global.c:218 global.c:389 +#: global.c:219 global.c:401 msgid "Exit" msgstr "" -#: global.c:226 global.c:319 global.c:341 global.c:361 +#: global.c:227 global.c:320 global.c:342 global.c:362 msgid "Goto Line" msgstr "" -#: global.c:231 global.c:310 +#: global.c:232 global.c:311 msgid "Justify" msgstr "" -#: global.c:235 global.c:306 global.c:337 +#: global.c:236 global.c:307 global.c:338 msgid "Replace" msgstr "" -#: global.c:239 +#: global.c:240 msgid "Read File" msgstr "" -#: global.c:243 +#: global.c:244 msgid "Where Is" msgstr "" -#: global.c:247 global.c:381 +#: global.c:248 global.c:393 msgid "Prev Page" msgstr "" -#: global.c:251 global.c:385 +#: global.c:252 global.c:397 msgid "Next Page" msgstr "" -#: global.c:255 +#: global.c:256 msgid "Cut Text" msgstr "" -#: global.c:258 +#: global.c:259 msgid "UnCut Txt" msgstr "" -#: global.c:262 +#: global.c:263 msgid "Cur Pos" msgstr "" -#: global.c:266 +#: global.c:267 msgid "To Spell" msgstr "" -#: global.c:270 +#: global.c:271 msgid "Up" msgstr "" -#: global.c:273 +#: global.c:274 msgid "Down" msgstr "" -#: global.c:276 +#: global.c:277 msgid "Forward" msgstr "" -#: global.c:279 +#: global.c:280 msgid "Back" msgstr "" -#: global.c:282 +#: global.c:283 msgid "Home" msgstr "" -#: global.c:285 +#: global.c:286 msgid "End" msgstr "" -#: global.c:288 +#: global.c:289 msgid "Refresh" msgstr "" -#: global.c:291 +#: global.c:292 msgid "Mark Text" msgstr "" -#: global.c:294 +#: global.c:295 msgid "Delete" msgstr "" -#: global.c:298 +#: global.c:299 msgid "Backspace" msgstr "" -#: global.c:302 +#: global.c:303 msgid "Tab" msgstr "" -#: global.c:314 +#: global.c:315 msgid "Enter" msgstr "" -#: global.c:327 global.c:348 global.c:371 +#: global.c:328 global.c:349 global.c:370 global.c:383 msgid "First Line" msgstr "" -#: global.c:330 global.c:351 global.c:374 +#: global.c:331 global.c:352 global.c:373 global.c:386 msgid "Last Line" msgstr "" -#: global.c:333 global.c:354 +#: global.c:334 global.c:355 msgid "Case Sens" msgstr "" -#: global.c:344 global.c:367 global.c:377 global.c:393 global.c:397 -#: global.c:403 winio.c:971 +#: global.c:345 global.c:365 global.c:379 global.c:389 global.c:405 +#: global.c:409 global.c:415 winio.c:974 msgid "Cancel" msgstr "" -#: global.c:357 +#: global.c:358 msgid "No Replace" msgstr "" -#: global.c:364 +#: global.c:376 msgid "Null Str" msgstr "" @@ -733,31 +733,31 @@ msgstr "" msgid "I got Alt-%c! (%d)\n" msgstr "" -#: search.c:77 +#: search.c:79 #, c-format msgid "Case Sensitive Regexp Search%s%s" msgstr "" -#: search.c:79 +#: search.c:81 #, c-format msgid "Regexp Search%s%s" msgstr "" -#: search.c:81 +#: search.c:83 #, c-format msgid "Case Sensitive Search%s%s" msgstr "" -#: search.c:83 +#: search.c:85 #, c-format msgid "Search%s%s" msgstr "" -#: search.c:86 +#: search.c:88 msgid " (to replace)" msgstr "" -#: search.c:94 +#: search.c:96 msgid "Search Cancelled" msgstr "" @@ -774,43 +774,32 @@ msgstr "" msgid "Replaced 1 occurence" msgstr "" -#: search.c:396 search.c:429 +#: search.c:396 search.c:427 msgid "Replace Cancelled" msgstr "" -#. They used ^N in the search field, shame on them. -#. Any Dungeon fans out there? -#: search.c:413 -msgid "Nothing Happens" -msgstr "" - #: search.c:421 -#, c-format -msgid "Replace with [%s]" -msgstr "" - -#: search.c:423 msgid "Replace with" msgstr "" -#: search.c:474 +#: search.c:461 msgid "Replace this instance?" msgstr "" #. Ask for it -#: search.c:535 +#: search.c:522 msgid "Enter line number" msgstr "" -#: search.c:537 +#: search.c:524 msgid "Aborted" msgstr "" -#: search.c:557 +#: search.c:544 msgid "Come on, be reasonable" msgstr "" -#: search.c:562 +#: search.c:549 #, c-format msgid "Only %d lines available, skipping to last line" msgstr "" @@ -825,62 +814,62 @@ msgstr "" msgid "input '%c' (%d)\n" msgstr "" -#: winio.c:424 +#: winio.c:427 msgid "New Buffer" msgstr "" -#: winio.c:427 +#: winio.c:430 msgid " File: ..." msgstr "" -#: winio.c:435 +#: winio.c:438 msgid "Modified" msgstr "" -#: winio.c:887 +#: winio.c:890 #, c-format msgid "Moved to (%d, %d) in edit buffer\n" msgstr "" -#: winio.c:898 +#: winio.c:901 #, c-format msgid "current->data = \"%s\"\n" msgstr "" -#: winio.c:941 +#: winio.c:944 #, c-format msgid "I got \"%s\"\n" msgstr "" -#: winio.c:966 +#: winio.c:969 msgid "Yes" msgstr "" -#: winio.c:968 +#: winio.c:971 msgid "All" msgstr "" -#: winio.c:970 +#: winio.c:973 msgid "No" msgstr "" -#: winio.c:1107 +#: winio.c:1110 #, c-format msgid "do_cursorpos: linepct = %f, bytepct = %f\n" msgstr "" -#: winio.c:1111 +#: winio.c:1114 msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)" msgstr "" -#: winio.c:1239 +#: winio.c:1242 msgid "Dumping file buffer to stderr...\n" msgstr "" -#: winio.c:1241 +#: winio.c:1244 msgid "Dumping cutbuffer to stderr...\n" msgstr "" -#: winio.c:1243 +#: winio.c:1246 msgid "Dumping a buffer to stderr...\n" msgstr "" diff --git a/proto.h b/proto.h index 67e5ea38..bc410e36 100644 --- a/proto.h +++ b/proto.h @@ -47,7 +47,7 @@ extern shortcut *shortcut_list; extern shortcut main_list[MAIN_LIST_LEN], whereis_list[WHEREIS_LIST_LEN]; extern shortcut replace_list[REPLACE_LIST_LEN], goto_list[GOTO_LIST_LEN]; extern shortcut writefile_list[WRITEFILE_LIST_LEN], help_list[HELP_LIST_LEN]; -extern shortcut spell_list[SPELL_LIST_LEN]; +extern shortcut spell_list[SPELL_LIST_LEN], replace_list_2[REPLACE_LIST_LEN]; #ifdef HAVE_REGEX_H extern int use_regexp, regexp_compiled; diff --git a/search.c b/search.c index edd47a49..c3b3c080 100644 --- a/search.c +++ b/search.c @@ -64,14 +64,16 @@ void regexp_cleanup() int search_init(int replacing) { int i; - char buf[BUFSIZ]; +/* char buf[BUFSIZ]; */ char *prompt, *reprompt = ""; +/* if (last_search[0]) { snprintf(buf, BUFSIZ, " [%s]", last_search); } else { buf[0] = '\0'; } +*/ if (ISSET(USE_REGEXP) && ISSET(CASE_SENSITIVE)) prompt = _("Case Sensitive Regexp Search%s%s"); @@ -86,8 +88,8 @@ int search_init(int replacing) reprompt = _(" (to replace)"); i = statusq(replacing ? replace_list : whereis_list, - replacing ? REPLACE_LIST_LEN : WHEREIS_LIST_LEN, "", - prompt, reprompt, buf); + replacing ? REPLACE_LIST_LEN : WHEREIS_LIST_LEN, last_search, + prompt, reprompt, ""); /* Cancel any search, or just return with no previous search */ if ((i == -1) || (i < 0 && !last_search[0])) { @@ -121,9 +123,7 @@ int search_init(int replacing) } else if (i == NANO_FROMSEARCHTOGOTO_KEY) { do_gotoline_void(); return -3; - } else if (i == NANO_NULL_KEY) /* They hit ^N! */ - strncpy(last_search, "", 132); - else { /* First line key, etc. */ + } else { /* First line key, etc. */ do_early_abort(); return -3; } @@ -407,20 +407,18 @@ int do_replace(void) return 0; } - if (!strcmp(answer, "")) { - /* They used ^N in the search field, shame on them. - Any Dungeon fans out there? */ - statusbar(_("Nothing Happens")); - replace_abort(); - return 0; - } strncpy(prevanswer, answer, 132); - if (strcmp(last_replace, "")) /* There's a previous replace str */ - i = statusq(replace_list, REPLACE_LIST_LEN, "", +/* + if (strcmp(last_replace, "")) * There's a previous replace str * + i = statusq(replace_list_2, REPLACE_LIST_2_LEN, "", _("Replace with [%s]"), last_replace); else - i = statusq(replace_list, REPLACE_LIST_LEN, "", _("Replace with")); + i = statusq(replace_list_2, REPLACE_LIST_2_LEN, "", _("Replace with")); +*/ + + i = statusq(replace_list_2, REPLACE_LIST_2_LEN, last_replace, + _("Replace with")); switch (i) { case -1: /* Aborted enter */ @@ -435,17 +433,6 @@ int do_replace(void) case NANO_NULL_KEY: /* They want the null string */ strcpy(last_replace, ""); break; - case NANO_CASE_KEY: /* They asked for case sensitivity */ - if (ISSET(CASE_SENSITIVE)) - UNSET(CASE_SENSITIVE); - else - SET(CASE_SENSITIVE); - - do_replace(); - return 0; - case NANO_FROMSEARCHTOGOTO_KEY: /* Oops, they want goto line... */ - do_gotoline_void(); - return 0; default: if (i != -2) { /* First page, last page, for example could get here */ diff --git a/winio.c b/winio.c index 41c0c48a..721f0924 100644 --- a/winio.c +++ b/winio.c @@ -395,7 +395,10 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x) strncpy(answer, inputbuf, 132); - if (!strcmp(answer, "")) + /* Now that the text is editable instead of bracketed, we have to + check for answer == def, instead of answer == "" */ +/* if (!strcmp(answer, "")) */ + if (!strcmp(answer, def)) return -2; else return 0; -- 2.39.5