bindings: move the noconvert toggle from the main to the insert menu
Also add feedback, so that it will be clear whether a file will be inserted unconverted or not. This addresses https://savannah.gnu.org/bugs/?54536.master
parent
8d6b205e4c
commit
6d62682ddb
16
src/files.c
16
src/files.c
|
@ -1093,7 +1093,17 @@ void do_insertfile(void)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
if (ISSET(MULTIBUFFER))
|
if (ISSET(MULTIBUFFER))
|
||||||
msg = _("File to insert into new buffer [from %s]");
|
#ifndef NANO_TINY
|
||||||
|
if ISSET(NO_CONVERT)
|
||||||
|
msg = _("File to read unconverted into new buffer [from %s]");
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
msg = _("File to read into new buffer [from %s]");
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifndef NANO_TINY
|
||||||
|
if ISSET(NO_CONVERT)
|
||||||
|
msg = _("File to insert unconverted [from %s]");
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
msg = _("File to insert [from %s]");
|
msg = _("File to insert [from %s]");
|
||||||
|
@ -1139,6 +1149,10 @@ void do_insertfile(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
|
if (func == flip_convert) {
|
||||||
|
TOGGLE(NO_CONVERT);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (func == flip_execute) {
|
if (func == flip_execute) {
|
||||||
execute = !execute;
|
execute = !execute;
|
||||||
continue;
|
continue;
|
||||||
|
|
15
src/global.c
15
src/global.c
|
@ -325,6 +325,9 @@ void flip_execute(void)
|
||||||
void flip_pipe(void)
|
void flip_pipe(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void flip_convert(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
void flip_newbuffer(void)
|
void flip_newbuffer(void)
|
||||||
|
@ -650,6 +653,7 @@ void shortcut_init(void)
|
||||||
const char *execute_gist = N_("Execute external command");
|
const char *execute_gist = N_("Execute external command");
|
||||||
const char *pipe_gist =
|
const char *pipe_gist =
|
||||||
N_("Pipe the current buffer (or marked region) to the command");
|
N_("Pipe the current buffer (or marked region) to the command");
|
||||||
|
const char *convert_gist = N_("Do not convert from DOS/Mac format");
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
const char *newbuffer_gist = N_("Toggle the use of a new buffer");
|
const char *newbuffer_gist = N_("Toggle the use of a new buffer");
|
||||||
|
@ -1011,6 +1015,9 @@ void shortcut_init(void)
|
||||||
add_to_funcs(flip_execute, MEXTCMD,
|
add_to_funcs(flip_execute, MEXTCMD,
|
||||||
N_("Read File"), WITHORSANS(readfile_gist), TOGETHER, NOVIEW);
|
N_("Read File"), WITHORSANS(readfile_gist), TOGETHER, NOVIEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_to_funcs(flip_convert, MINSERTFILE,
|
||||||
|
N_("No Conversion"), WITHORSANS(convert_gist), TOGETHER, NOVIEW);
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
/* Multiple buffers are only available when not in restricted mode. */
|
/* Multiple buffers are only available when not in restricted mode. */
|
||||||
|
@ -1256,7 +1263,6 @@ void shortcut_init(void)
|
||||||
#ifdef ENABLE_MOUSE
|
#ifdef ENABLE_MOUSE
|
||||||
add_to_sclist(MMAIN, "M-M", 0, do_toggle_void, USE_MOUSE);
|
add_to_sclist(MMAIN, "M-M", 0, do_toggle_void, USE_MOUSE);
|
||||||
#endif
|
#endif
|
||||||
add_to_sclist(MMAIN, "M-N", 0, do_toggle_void, NO_CONVERT);
|
|
||||||
add_to_sclist(MMAIN, "M-Z", 0, do_toggle_void, SUSPEND);
|
add_to_sclist(MMAIN, "M-Z", 0, do_toggle_void, SUSPEND);
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
|
@ -1313,6 +1319,7 @@ void shortcut_init(void)
|
||||||
add_to_sclist(MWRITEFILE, "M-B", 0, backup_file_void, 0);
|
add_to_sclist(MWRITEFILE, "M-B", 0, backup_file_void, 0);
|
||||||
add_to_sclist(MINSERTFILE|MEXTCMD, "^X", 0, flip_execute, 0);
|
add_to_sclist(MINSERTFILE|MEXTCMD, "^X", 0, flip_execute, 0);
|
||||||
}
|
}
|
||||||
|
add_to_sclist(MINSERTFILE, "M-N", 0, flip_convert, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
/* Only when not in restricted mode, allow multiple buffers. */
|
/* Only when not in restricted mode, allow multiple buffers. */
|
||||||
|
@ -1413,8 +1420,6 @@ const char *flagtostr(int flag)
|
||||||
return N_("Reading file into separate buffer");
|
return N_("Reading file into separate buffer");
|
||||||
case USE_MOUSE:
|
case USE_MOUSE:
|
||||||
return N_("Mouse support");
|
return N_("Mouse support");
|
||||||
case NO_CONVERT:
|
|
||||||
return N_("No conversion from DOS/Mac format");
|
|
||||||
case SUSPEND:
|
case SUSPEND:
|
||||||
return N_("Suspension");
|
return N_("Suspension");
|
||||||
case LINE_NUMBERS:
|
case LINE_NUMBERS:
|
||||||
|
@ -1622,6 +1627,8 @@ sc *strtosc(const char *input)
|
||||||
s->func = flip_execute;
|
s->func = flip_execute;
|
||||||
else if (!strcasecmp(input, "flippipe"))
|
else if (!strcasecmp(input, "flippipe"))
|
||||||
s->func = flip_pipe;
|
s->func = flip_pipe;
|
||||||
|
else if (!strcasecmp(input, "flipconvert"))
|
||||||
|
s->func = flip_convert;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
else if (!strcasecmp(input, "flipnewbuffer"))
|
else if (!strcasecmp(input, "flipnewbuffer"))
|
||||||
|
@ -1685,8 +1692,6 @@ sc *strtosc(const char *input)
|
||||||
else if (!strcasecmp(input, "mouse"))
|
else if (!strcasecmp(input, "mouse"))
|
||||||
s->toggle = USE_MOUSE;
|
s->toggle = USE_MOUSE;
|
||||||
#endif
|
#endif
|
||||||
else if (!strcasecmp(input, "noconvert"))
|
|
||||||
s->toggle = NO_CONVERT;
|
|
||||||
else if (!strcasecmp(input, "suspendenable"))
|
else if (!strcasecmp(input, "suspendenable"))
|
||||||
s->toggle = SUSPEND;
|
s->toggle = SUSPEND;
|
||||||
else
|
else
|
||||||
|
|
|
@ -703,6 +703,7 @@ void prepend_void(void);
|
||||||
void backup_file_void(void);
|
void backup_file_void(void);
|
||||||
void flip_execute(void);
|
void flip_execute(void);
|
||||||
void flip_pipe(void);
|
void flip_pipe(void);
|
||||||
|
void flip_convert(void);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
void flip_newbuffer(void);
|
void flip_newbuffer(void);
|
||||||
|
|
Loading…
Reference in New Issue