bindings: allow toggling a new buffer when multiple buffers are enabled

When configured with --enable-tiny --enable-multibuffer,
/do/ include the new-buffer toggle in the Read-File menu.
This commit is contained in:
Benno Schulenberg
2017-05-08 13:20:07 +02:00
parent e701bb01aa
commit 9ea5eef200
3 changed files with 14 additions and 8 deletions

View File

@@ -1106,12 +1106,11 @@ void do_insertfile(void)
} else {
ssize_t was_current_lineno = openfile->current->lineno;
size_t was_current_x = openfile->current_x;
#if !defined(NANO_TINY) || !defined(DISABLE_BROWSER)
#if !defined(NANO_TINY) || !defined(DISABLE_BROWSER) || defined(ENABLE_MULTIBUFFER)
functionptrtype func = func_from_key(&i);
#endif
given = mallocstrcpy(given, answer);
#ifndef NANO_TINY
#ifdef ENABLE_MULTIBUFFER
if (func == new_buffer_void) {
/* Don't allow toggling when in view mode. */
@@ -1122,12 +1121,12 @@ void do_insertfile(void)
continue;
}
#endif
#ifndef NANO_TINY
if (func == flip_execute_void) {
execute = !execute;
continue;
}
#endif /* !NANO_TINY */
#endif
#ifndef DISABLE_BROWSER
if (func == to_files_void) {
char *chosen = do_browse_from(answer);