Using still further the func_from_key() wrapper instead of get_shortcut().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5084 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
47dffa483f
Коммит
7239fda971
@ -6,6 +6,7 @@
|
|||||||
* src/prompt.c (do_yesno_prompt): Use the new and more direct
|
* src/prompt.c (do_yesno_prompt): Use the new and more direct
|
||||||
func_from_key() wrapper instead of get_shortcut().
|
func_from_key() wrapper instead of get_shortcut().
|
||||||
* src/text.c (do_linter): Likewise.
|
* src/text.c (do_linter): Likewise.
|
||||||
|
* src/files.c (do_insertfile, do_writeout): Likewise.
|
||||||
|
|
||||||
2014-07-24 Jordi Mallach <jordi@gnu.org>
|
2014-07-24 Jordi Mallach <jordi@gnu.org>
|
||||||
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
|
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.
|
||||||
|
28
src/files.c
28
src/files.c
@ -1026,7 +1026,6 @@ void do_insertfile(
|
|||||||
size_t current_x_save = openfile->current_x;
|
size_t current_x_save = openfile->current_x;
|
||||||
ssize_t current_y_save = openfile->current_y;
|
ssize_t current_y_save = openfile->current_y;
|
||||||
bool edittop_inside = FALSE;
|
bool edittop_inside = FALSE;
|
||||||
const sc *s;
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
bool right_side_up = FALSE, single_line = FALSE;
|
bool right_side_up = FALSE, single_line = FALSE;
|
||||||
#endif
|
#endif
|
||||||
@ -1084,14 +1083,13 @@ void do_insertfile(
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
size_t pww_save = openfile->placewewant;
|
size_t pww_save = openfile->placewewant;
|
||||||
|
functionptrtype func = func_from_key(&i);
|
||||||
|
|
||||||
ans = mallocstrcpy(ans, answer);
|
ans = mallocstrcpy(ans, answer);
|
||||||
|
|
||||||
s = get_shortcut(&i);
|
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
#ifndef DISABLE_MULTIBUFFER
|
#ifndef DISABLE_MULTIBUFFER
|
||||||
if (s && s->scfunc == new_buffer_void) {
|
if (func == new_buffer_void) {
|
||||||
/* Don't allow toggling if we're in view mode. */
|
/* Don't allow toggling if we're in view mode. */
|
||||||
if (!ISSET(VIEW_MODE))
|
if (!ISSET(VIEW_MODE))
|
||||||
TOGGLE(MULTIBUFFER);
|
TOGGLE(MULTIBUFFER);
|
||||||
@ -1100,14 +1098,14 @@ void do_insertfile(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (s && s->scfunc == flip_execute_void) {
|
if (func == flip_execute_void) {
|
||||||
execute = !execute;
|
execute = !execute;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
#ifndef DISABLE_BROWSER
|
#ifndef DISABLE_BROWSER
|
||||||
if (s && s->scfunc == to_files_void) {
|
if (func == to_files_void) {
|
||||||
char *tmp = do_browse_from(answer);
|
char *tmp = do_browse_from(answer);
|
||||||
|
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
@ -2234,7 +2232,6 @@ bool do_writeout(bool exiting)
|
|||||||
static bool did_credits = FALSE;
|
static bool did_credits = FALSE;
|
||||||
#endif
|
#endif
|
||||||
bool retval = FALSE;
|
bool retval = FALSE;
|
||||||
const sc *s;
|
|
||||||
|
|
||||||
currmenu = MWRITEFILE;
|
currmenu = MWRITEFILE;
|
||||||
|
|
||||||
@ -2306,11 +2303,12 @@ bool do_writeout(bool exiting)
|
|||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
functionptrtype func = func_from_key(&i);
|
||||||
|
|
||||||
ans = mallocstrcpy(ans, answer);
|
ans = mallocstrcpy(ans, answer);
|
||||||
s = get_shortcut(&i);
|
|
||||||
|
|
||||||
#ifndef DISABLE_BROWSER
|
#ifndef DISABLE_BROWSER
|
||||||
if (s && s->scfunc == to_files_void) {
|
if (func == to_files_void) {
|
||||||
char *tmp = do_browse_from(answer);
|
char *tmp = do_browse_from(answer);
|
||||||
|
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
@ -2322,26 +2320,26 @@ bool do_writeout(bool exiting)
|
|||||||
} else
|
} else
|
||||||
#endif /* !DISABLE_BROWSER */
|
#endif /* !DISABLE_BROWSER */
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (s && s->scfunc == dos_format_void) {
|
if (func == dos_format_void) {
|
||||||
openfile->fmt = (openfile->fmt == DOS_FILE) ? NIX_FILE :
|
openfile->fmt = (openfile->fmt == DOS_FILE) ? NIX_FILE :
|
||||||
DOS_FILE;
|
DOS_FILE;
|
||||||
continue;
|
continue;
|
||||||
} else if (s && s->scfunc == mac_format_void) {
|
} else if (func == mac_format_void) {
|
||||||
openfile->fmt = (openfile->fmt == MAC_FILE) ? NIX_FILE :
|
openfile->fmt = (openfile->fmt == MAC_FILE) ? NIX_FILE :
|
||||||
MAC_FILE;
|
MAC_FILE;
|
||||||
continue;
|
continue;
|
||||||
} else if (s && s->scfunc == backup_file_void) {
|
} else if (func == backup_file_void) {
|
||||||
TOGGLE(BACKUP_FILE);
|
TOGGLE(BACKUP_FILE);
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
if (s && s->scfunc == prepend_void) {
|
if (func == prepend_void) {
|
||||||
append = (append == PREPEND) ? OVERWRITE : PREPEND;
|
append = (append == PREPEND) ? OVERWRITE : PREPEND;
|
||||||
continue;
|
continue;
|
||||||
} else if (s && s->scfunc == append_void) {
|
} else if (func == append_void) {
|
||||||
append = (append == APPEND) ? OVERWRITE : APPEND;
|
append = (append == APPEND) ? OVERWRITE : APPEND;
|
||||||
continue;
|
continue;
|
||||||
} else if (s && s->scfunc == do_help_void) {
|
} else if (func == do_help_void) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user