inaccuracy in the description of -Q/--quotestr. (DLR)
- Set REG_EXTENDED in all regcomp() calls. (DLR)
- Minor cosmetic code cleanups. (DLR)
+ - Changed do_insertfile to (a) report multibuffer status at the
+ prompt and allowing it to be toggled, taking into account the
+ need to keep the translatable strings, and (b) added a
+ variable inspath to keep track of what the string was before
+ toggling. I'm sure there's bugs, have at it.
- configure.ac:
- Added pt_BR to ALL_LINGUAS (Jordi).
- Changed --enable-color warning to be slightly less severe.
{
int i, old_current_x = current_x;
char *realname = NULL;
+ static char *inspath = NULL;
+
+ if (inspath == NULL)
+ inspath = mallocstrcpy(inspath, "");
wrap_reset();
#ifndef DISABLE_OPERATINGDIR
if (operating_dir && strcmp(operating_dir, "."))
- i = statusq(1, insertfile_list, "", _("File to insert [from %s] "),
+#ifdef ENABLE_MULTIBUFFER
+ if (ISSET(MULTIBUFFER))
+ i = statusq(1, insertfile_list, inspath, _("File to insert into new buffer [from %s] "),
+ operating_dir);
+ else
+#endif
+ i = statusq(1, insertfile_list, inspath, _("File to insert [from %s] "),
operating_dir);
+
else
#endif
- i = statusq(1, insertfile_list, "", _("File to insert [from ./] "));
+#ifdef ENABLE_MULTIBUFFER
+ if (ISSET(MULTIBUFFER))
+ i = statusq(1, insertfile_list, inspath, _("File to insert into new buffer [from ./] "));
+ else
+#endif
+ i = statusq(1, insertfile_list, inspath, _("File to insert [from ./] "));
if (i != -1) {
+
+ inspath = mallocstrcpy(inspath, answer);
+
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), answer);
#endif
+
#ifndef DISABLE_TABCOMP
realname = real_dir_from_tilde(answer);
#else
}
#endif
+#ifdef ENABLE_MULTIBUFFER
+ if (i == TOGGLE_LOAD_KEY) {
+ TOGGLE(MULTIBUFFER);
+ return do_insertfile(loading_file);
+ }
+#endif
#ifndef NANO_SMALL
if (i == NANO_EXTCMD_KEY) {
int ts;
}
#endif
+
+
/* If we've gone off the bottom, recenter; otherwise, just redraw */
if (current->lineno > editbot->lineno)
edit_update(current, CENTER);
update_color();
#endif
- UNSET(KEEP_CUTBUFFER);
- display_main_list();
- return i;
} else {
statusbar(_("Cancelled"));
- UNSET(KEEP_CUTBUFFER);
- display_main_list();
- return 0;
+ i = 0;
}
+
+ free(inspath);
+ inspath = NULL;
+
+ UNSET(KEEP_CUTBUFFER);
+ display_main_list();
+ return i;
}
int do_insertfile_void(void)
"", *nano_backup_msg = "";
#ifdef ENABLE_MULTIBUFFER
- char *nano_openprev_msg = "", *nano_opennext_msg = "";
+ char *nano_openprev_msg = "", *nano_opennext_msg = "",
+ *nano_multibuffer_msg = "";
#endif
#ifdef HAVE_REGEX_H
char *nano_regexp_msg = "", *nano_bracket_msg = "";
#ifdef ENABLE_MULTIBUFFER
nano_openprev_msg = _("Open previously loaded file");
nano_opennext_msg = _("Open next loaded file");
+ nano_multibuffer_msg = _("Toggle insert into new buffer");
#endif
#endif /* !DISABLE_HELP */
sc_init_one(&insertfile_list, NANO_EXTCMD_KEY, _("Execute Command"),
IFHELP(nano_execute_msg, 0), 0, 0, NOVIEW, 0);
#endif
+#ifdef ENABLE_MULTIBUFFER
+ sc_init_one(&insertfile_list, TOGGLE_LOAD_KEY, _("New Buffer"),
+ IFHELP(nano_multibuffer_msg, 0), 0, 0, NOVIEW, 0);
+#endif
free_shortcutage(&spell_list);