add a multibuffer mode toggle to the "Execute Command" prompt, for
consistency with the "Read File" prompt git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1952 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
@@ -54,6 +54,9 @@ CVS code -
|
|||||||
extended keypad values. This is needed for UTF-8 support.
|
extended keypad values. This is needed for UTF-8 support.
|
||||||
Changes to get_kbinput(), get_translated_kbinput(),
|
Changes to get_kbinput(), get_translated_kbinput(),
|
||||||
get_shortcut(), get_edit_input(), etc. (DLR)
|
get_shortcut(), get_edit_input(), etc. (DLR)
|
||||||
|
- Add a multibuffer mode toggle to the "Execute Command" prompt,
|
||||||
|
for consistency with the "Read File" prompt. Changes to
|
||||||
|
do_insertfile() and shortcut_init(). (DLR)
|
||||||
- files.c:
|
- files.c:
|
||||||
do_insertfile()
|
do_insertfile()
|
||||||
- Readd the NANO_SMALL #ifdef around the start_again: label to
|
- Readd the NANO_SMALL #ifdef around the start_again: label to
|
||||||
|
|||||||
26
src/files.c
26
src/files.c
@@ -494,6 +494,7 @@ void do_insertfile(void)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
msg = N_("File to insert [from %s] ");
|
msg = N_("File to insert [from %s] ");
|
||||||
|
|
||||||
i = statusq(TRUE, insertfile_list, ans,
|
i = statusq(TRUE, insertfile_list, ans,
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
NULL,
|
NULL,
|
||||||
@@ -520,8 +521,29 @@ void do_insertfile(void)
|
|||||||
}
|
}
|
||||||
#endif /* ENABLE_MULTIBUFFER */
|
#endif /* ENABLE_MULTIBUFFER */
|
||||||
if (i == NANO_EXTCMD_KEY) {
|
if (i == NANO_EXTCMD_KEY) {
|
||||||
int j = statusq(TRUE, extcmd_list, ans, NULL,
|
int j;
|
||||||
_("Command to execute"));
|
|
||||||
|
exec_again: /* Go here when the user toggles multibuffer mode. */
|
||||||
|
|
||||||
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
|
if (ISSET(MULTIBUFFER))
|
||||||
|
msg = N_("Command to execute in new buffer");
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
msg = N_("Command to execute");
|
||||||
|
|
||||||
|
j = statusq(TRUE, extcmd_list, ans, NULL, _(msg));
|
||||||
|
|
||||||
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
|
if (j == TOGGLE_MULTIBUFFER_KEY) {
|
||||||
|
/* Don't allow toggling if we're in view mode. */
|
||||||
|
if (!ISSET(VIEW_MODE)) {
|
||||||
|
TOGGLE(MULTIBUFFER);
|
||||||
|
ans = mallocstrcpy(NULL, answer);
|
||||||
|
}
|
||||||
|
goto exec_again;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (j == -1 || answer == NULL || answer[0] == '\0')
|
if (j == -1 || answer == NULL || answer[0] == '\0')
|
||||||
goto start_again;
|
goto start_again;
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ void shortcut_init(int unjustify)
|
|||||||
const char *regexp_msg = N_("Regexp");
|
const char *regexp_msg = N_("Regexp");
|
||||||
#endif
|
#endif
|
||||||
const char *history_msg = N_("History");
|
const char *history_msg = N_("History");
|
||||||
|
const char *new_buffer_msg = N_("New Buffer");
|
||||||
#endif /* !NANO_SMALL */
|
#endif /* !NANO_SMALL */
|
||||||
#ifndef DISABLE_BROWSER
|
#ifndef DISABLE_BROWSER
|
||||||
const char *to_files_msg = N_("To Files");
|
const char *to_files_msg = N_("To Files");
|
||||||
@@ -898,7 +899,7 @@ void shortcut_init(int unjustify)
|
|||||||
* disabled. It's useless since inserting files is disabled. */
|
* disabled. It's useless since inserting files is disabled. */
|
||||||
/* Translators: try to keep this string under 22 characters long */
|
/* Translators: try to keep this string under 22 characters long */
|
||||||
if (!ISSET(RESTRICTED))
|
if (!ISSET(RESTRICTED))
|
||||||
sc_init_one(&insertfile_list, NANO_NO_KEY, N_("New Buffer"),
|
sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg,
|
||||||
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY,
|
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY,
|
||||||
NANO_NO_KEY, NOVIEW, 0);
|
NANO_NO_KEY, NOVIEW, 0);
|
||||||
#endif
|
#endif
|
||||||
@@ -938,6 +939,10 @@ void shortcut_init(int unjustify)
|
|||||||
sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg,
|
sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg,
|
||||||
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
||||||
NANO_NO_KEY, VIEW, 0);
|
NANO_NO_KEY, VIEW, 0);
|
||||||
|
|
||||||
|
sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg,
|
||||||
|
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY,
|
||||||
|
NANO_NO_KEY, NOVIEW, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_BROWSER
|
#ifndef DISABLE_BROWSER
|
||||||
|
|||||||
Reference in New Issue
Block a user