diff --git a/src/browser.c b/src/browser.c index 3c8191cf25a7d270859d76cee547e743bf33c9fe..4605ff8df57de4b59b78fddf4c81571147d7f691 100644 --- a/src/browser.c +++ b/src/browser.c @@ -219,11 +219,7 @@ char *do_browser(char *path) selected = filelist_len - 1; } else if (func == goto_dir_void) { /* Ask for the directory to go to. */ - int i = do_prompt(TRUE, -#ifndef DISABLE_TABCOMP - FALSE, -#endif - MGOTODIR, NULL, + int i = do_prompt(TRUE, FALSE, MGOTODIR, NULL, #ifndef DISABLE_HISTORIES NULL, #endif @@ -670,11 +666,7 @@ int filesearch_init(void) buf = mallocstrcpy(NULL, ""); /* This is now one simple call. It just does a lot. */ - input = do_prompt(FALSE, -#ifndef DISABLE_TABCOMP - FALSE, -#endif - MWHEREISFILE, NULL, + input = do_prompt(FALSE, FALSE, MWHEREISFILE, NULL, #ifndef DISABLE_HISTORIES &search_history, #endif diff --git a/src/files.c b/src/files.c index 9b14ef995002fd3595bd73cce287c6866453c83b..b1c5f5add1eed0451877327a23c8e793ae6aef9b 100644 --- a/src/files.c +++ b/src/files.c @@ -1087,10 +1087,7 @@ void do_insertfile(void) present_path = mallocstrcpy(present_path, "./"); - i = do_prompt(TRUE, -#ifndef DISABLE_TABCOMP - TRUE, -#endif + i = do_prompt(TRUE, TRUE, #ifndef NANO_TINY execute ? MEXTCMD : #endif @@ -2224,10 +2221,7 @@ int do_writeout(bool exiting) /* If we're using restricted mode, and the filename isn't blank, * disable tab completion. */ i = do_prompt(!ISSET(RESTRICTED) || openfile->filename[0] == '\0', -#ifndef DISABLE_TABCOMP - TRUE, -#endif - MWRITEFILE, given, + TRUE, MWRITEFILE, given, #ifndef DISABLE_HISTORIES NULL, #endif diff --git a/src/prompt.c b/src/prompt.c index 0bb6daba6891e38cf97ac30769d36a1c42d01aac..8dceece0bbfb76d19210597409f4f2b2970758d5 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -433,9 +433,7 @@ void update_the_statusbar(void) /* Get a string of input at the statusbar prompt. */ functionptrtype acquire_an_answer(int *actual, bool allow_tabs, -#ifndef DISABLE_TABCOMP bool allow_files, bool *listed, -#endif #ifndef DISABLE_HISTORIES filestruct **history_list, #endif @@ -613,10 +611,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs, * The allow_tabs parameter indicates whether we should allow tabs to be * interpreted. The allow_files parameter indicates whether we should * allow all files (as opposed to just directories) to be tab completed. */ -int do_prompt(bool allow_tabs, -#ifndef DISABLE_TABCOMP - bool allow_files, -#endif +int do_prompt(bool allow_tabs, bool allow_files, int menu, const char *curranswer, #ifndef DISABLE_HISTORIES filestruct **history_list, @@ -626,9 +621,7 @@ int do_prompt(bool allow_tabs, va_list ap; int retval; functionptrtype func = NULL; -#ifndef DISABLE_TABCOMP bool listed = FALSE; -#endif /* Save a possible current statusbar x position. */ size_t was_statusbar_x = statusbar_x; @@ -646,10 +639,7 @@ int do_prompt(bool allow_tabs, /* Reserve five columns for colon plus angles plus answer, ":<aa>". */ null_at(&prompt, actual_x(prompt, (COLS < 5) ? 0 : COLS - 5)); - func = acquire_an_answer(&retval, allow_tabs, -#ifndef DISABLE_TABCOMP - allow_files, &listed, -#endif + func = acquire_an_answer(&retval, allow_tabs, allow_files, &listed, #ifndef DISABLE_HISTORIES history_list, #endif diff --git a/src/proto.h b/src/proto.h index 6aca349dbc9ee2d7e3866b672858627371c1be4e..126295ff3429b525de8d0414dac45985b5e8f355 100644 --- a/src/proto.h +++ b/src/proto.h @@ -503,10 +503,7 @@ size_t get_statusbar_page_start(size_t start_col, size_t column); void reinit_statusbar_x(void); void reset_statusbar_cursor(void); void update_the_statusbar(void); -int do_prompt(bool allow_tabs, -#ifndef DISABLE_TABCOMP - bool allow_files, -#endif +int do_prompt(bool allow_tabs, bool allow_files, int menu, const char *curranswer, #ifndef DISABLE_HISTORIES filestruct **history_list, diff --git a/src/search.c b/src/search.c index e11da9ef4df4398a24c84db9f86a3b7c22e7539b..9b67997e4143232738f68a6512f5427efcc7427d 100644 --- a/src/search.c +++ b/src/search.c @@ -147,10 +147,7 @@ int search_init(bool replacing, bool use_answer) buf = mallocstrcpy(NULL, ""); /* This is now one simple call. It just does a lot. */ - i = do_prompt(FALSE, -#ifndef DISABLE_TABCOMP - FALSE, -#endif + i = do_prompt(FALSE, FALSE, replacing ? MREPLACE : MWHEREIS, backupstring, #ifndef DISABLE_HISTORIES &search_history, @@ -785,11 +782,7 @@ void do_replace(void) if (i != 0) return; - i = do_prompt(FALSE, -#ifndef DISABLE_TABCOMP - FALSE, -#endif - MREPLACEWITH, NULL, + i = do_prompt(FALSE, FALSE, MREPLACEWITH, NULL, #ifndef DISABLE_HISTORIES &replace_history, #endif @@ -854,11 +847,8 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, functionptrtype func; /* Ask for the line and column. */ - int i = do_prompt(FALSE, -#ifndef DISABLE_TABCOMP - FALSE, -#endif - MGOTOLINE, use_answer ? answer : NULL, + int i = do_prompt(FALSE, FALSE, MGOTOLINE, + use_answer ? answer : NULL, #ifndef DISABLE_HISTORIES NULL, #endif diff --git a/src/text.c b/src/text.c index e7b9b083d8bdf8a6ed73d082f66426afe525bc19..2c9e5f516e2c423eacb31855b232545fca4c3a6f 100644 --- a/src/text.c +++ b/src/text.c @@ -2664,11 +2664,7 @@ bool do_int_spell_fix(const char *word) spotlight(TRUE, exp_word); /* Let the user supply a correctly spelled alternative. */ - proceed = (do_prompt(FALSE, -#ifndef DISABLE_TABCOMP - FALSE, -#endif - MSPELL, word, + proceed = (do_prompt(FALSE, FALSE, MSPELL, word, #ifndef DISABLE_HISTORIES NULL, #endif