last_replace back to nano.c (*shrug*).
- New tab completion code. Used check_wildcard_match, input_tab,
cwd_tab_completion, username_tab_completion from busybox,
- hacked them a lot, changes to nanogetstr().
+ hacked them a lot, changes to nanogetstr(). nanogetstr() and
+ statusq() now take an arg for whether or not to allow tab
+ completion.
- files.c:
do_writeout()
- Change strcpy to answer to mallocstrcpy.
int i;
wrap_reset();
- i = statusq(writefile_list, WRITEFILE_LIST_LEN, "",
+ i = statusq(1, writefile_list, WRITEFILE_LIST_LEN, "",
_("File to insert [from ./] "));
if (i != -1) {
}
while (1) {
- i = statusq(writefile_list, WRITEFILE_LIST_LEN, answer,
+ i = statusq(1, writefile_list, WRITEFILE_LIST_LEN, answer,
_("File Name to write"));
if (i != -1) {
free(foo);
wrefresh(edit);
num_matches = 0;
- }
+ } else
+ beep();
}
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-11-05 17:48-0500\n"
+"POT-Creation-Date: 2000-11-05 21:55-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
#: global.c:344 global.c:364 global.c:375 global.c:385 global.c:401
-#: global.c:405 global.c:411 winio.c:1009
+#: global.c:405 global.c:411 winio.c:1008
msgid "Cancel"
msgstr ""
msgid "actual_x_from_start for xplus=%d returned %d\n"
msgstr ""
-#: winio.c:424
+#: winio.c:421
#, c-format
msgid "input '%c' (%d)\n"
msgstr ""
-#: winio.c:462
+#: winio.c:459
msgid "New Buffer"
msgstr ""
-#: winio.c:465
+#: winio.c:462
msgid " File: ..."
msgstr ""
-#: winio.c:473
+#: winio.c:470
msgid "Modified"
msgstr ""
-#: winio.c:925
+#: winio.c:922
#, c-format
msgid "Moved to (%d, %d) in edit buffer\n"
msgstr ""
-#: winio.c:936
+#: winio.c:933
#, c-format
msgid "current->data = \"%s\"\n"
msgstr ""
-#: winio.c:979
+#: winio.c:978
#, c-format
msgid "I got \"%s\"\n"
msgstr ""
-#: winio.c:1004
+#: winio.c:1003
msgid "Yes"
msgstr ""
-#: winio.c:1006
+#: winio.c:1005
msgid "All"
msgstr ""
-#: winio.c:1008
+#: winio.c:1007
msgid "No"
msgstr ""
-#: winio.c:1145
+#: winio.c:1144
#, c-format
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
msgstr ""
-#: winio.c:1149
+#: winio.c:1148
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
msgstr ""
-#: winio.c:1277
+#: winio.c:1276
msgid "Dumping file buffer to stderr...\n"
msgstr ""
-#: winio.c:1279
+#: winio.c:1278
msgid "Dumping cutbuffer to stderr...\n"
msgstr ""
-#: winio.c:1281
+#: winio.c:1280
msgid "Dumping a buffer to stderr...\n"
msgstr ""
int do_yesno(int all, int leavecursor, char *msg, ...);
int actual_x(filestruct * fileptr, int xplus);
int strlenpt(char *buf);
-int statusq(shortcut s[], int slen, char *def, char *msg, ...);
+int statusq(int allowtabs, shortcut s[], int slen, char *def, char *msg, ...);
int write_file(char *name, int tmpfile);
int do_cut_text(void);
int do_uncut_text(void);
reprompt = _(" (to replace)");
if (ISSET(PICO_MSGS))
- i = statusq(replacing ? replace_list : whereis_list,
+ i = statusq(0, replacing ? replace_list : whereis_list,
replacing ? REPLACE_LIST_LEN : WHEREIS_LIST_LEN, "",
prompt, reprompt, buf);
else
- i = statusq(replacing ? replace_list : whereis_list,
+ i = statusq(0, replacing ? replace_list : whereis_list,
replacing ? REPLACE_LIST_LEN : WHEREIS_LIST_LEN, last_search,
prompt, reprompt, "");
} else
sprintf(buf, "%s", last_replace);
- i = statusq(replace_list_2, REPLACE_LIST_2_LEN, "",
+ i = statusq(0, replace_list_2, REPLACE_LIST_2_LEN, "",
_("Replace with [%s]"), buf);
}
else
- i = statusq(replace_list_2, REPLACE_LIST_2_LEN, "",
+ i = statusq(0, replace_list_2, REPLACE_LIST_2_LEN, "",
_("Replace with"));
}
else
- i = statusq(replace_list_2, REPLACE_LIST_2_LEN, last_replace,
+ i = statusq(0, replace_list_2, REPLACE_LIST_2_LEN, last_replace,
_("Replace with"));
/* save where we are */
line = defline;
else { /* Ask for it */
- j = statusq(goto_list, GOTO_LIST_LEN, "", _("Enter line number"));
+ j = statusq(0, goto_list, GOTO_LIST_LEN, "", _("Enter line number"));
if (j == -1) {
statusbar(_("Aborted"));
goto_abort();
}
/* Get the input from the kb, this should only be called from statusq */
-int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
+int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
+ int start_x)
{
int kbinput = 0, j = 0, x = 0, xend;
int x_left = 0, inputlen, tabbed = 0;
nanoget_repaint(buf, inputbuf, x);
break;
case NANO_CONTROL_I:
- tabbed++;
-#ifdef DEBUG
- fprintf(stderr, "Before call, x = %d\n", x);
-#endif
- x += input_tab(inputbuf, (x - x_left), tabbed - 1);
-#ifdef DEBUG
- fprintf(stderr, "After call, x = %d\n", x);
-#endif
- nanoget_repaint(buf, inputbuf, x);
- tabbed = 1;
+ if (allowtabs) {
+ tabbed++;
+ x += input_tab(inputbuf, (x - x_left), tabbed - 1);
+ nanoget_repaint(buf, inputbuf, x);
+ tabbed = 1;
+ }
break;
case KEY_LEFT:
if (x > strlen(buf))
* global. Returns -1 on aborted enter, -2 on a blank string, and 0
* otherwise, the valid shortcut key caught, Def is any editable text we
* want to put up by default.
+ *
+ * New arg tabs tells whether or not to allow tab completion.
*/
-int statusq(shortcut s[], int slen, char *def, char *msg, ...)
+int statusq(int tabs, shortcut s[], int slen, char *def, char *msg, ...)
{
va_list ap;
char foo[133];
strncat(foo, ": ", 132);
wattron(bottomwin, A_REVERSE);
- ret = nanogetstr(foo, def, s, slen, (strlen(foo) + 3));
+ ret = nanogetstr(tabs, foo, def, s, slen, (strlen(foo) + 3));
wattroff(bottomwin, A_REVERSE);
switch (ret) {