Concretize the usage of autocompliting in different input fields.
authorSlava Zanko <slavazanko@gmail.com>
Fri, 25 Jan 2013 14:29:15 +0000 (25 17:29 +0300)
committerSlava Zanko <slavazanko@gmail.com>
Mon, 4 Feb 2013 12:48:21 +0000 (4 15:48 +0300)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
20 files changed:
lib/vfs/utilvfs.c
lib/widget/input.h
src/diffviewer/search.c
src/diffviewer/ydiff.c
src/editor/editcmd.c
src/editor/editcmd_dialogs.c
src/editor/editoptions.c
src/filemanager/boxes.c
src/filemanager/cmd.c
src/filemanager/command.c
src/filemanager/ext.c
src/filemanager/filegui.c
src/filemanager/find.c
src/filemanager/hotlist.c
src/filemanager/panelize.c
src/filemanager/tree.c
src/filemanager/usermenu.c
src/vfs/ftpfs/ftpfs.c
src/viewer/dialogs.c
tests/lib/widget/complete_engine.c

index 1c9d5e7..d16ff06 100644 (file)
@@ -350,7 +350,7 @@ char *
 vfs_get_password (const char *msg)
 {
     return input_dialog (msg, _("Password:"), MC_HISTORY_VFS_PASSWORD, INPUT_PASSWORD,
-                         INPUT_COMPLETE_DEFAULT);
+                         INPUT_COMPLETE_NONE);
 }
 
 /* --------------------------------------------------------------------------------------------- */
index ff6a505..eb0d1b8 100644 (file)
@@ -29,6 +29,7 @@ typedef enum
 /* completion flags */
 typedef enum
 {
+    INPUT_COMPLETE_NONE = 0,
     INPUT_COMPLETE_FILENAMES = 1 << 0,
     INPUT_COMPLETE_HOSTNAMES = 1 << 1,
     INPUT_COMPLETE_COMMANDS = 1 << 2,
@@ -36,9 +37,6 @@ typedef enum
     INPUT_COMPLETE_USERNAMES = 1 << 4,
     INPUT_COMPLETE_CD = 1 << 5,
     INPUT_COMPLETE_SHELL_ESC = 1 << 6,
-
-    INPUT_COMPLETE_DEFAULT = INPUT_COMPLETE_FILENAMES
-        | INPUT_COMPLETE_HOSTNAMES | INPUT_COMPLETE_VARIABLES | INPUT_COMPLETE_USERNAMES
 } input_complete_t;
 
 /*** structures declarations (and typedefs of structures)*****************************************/
index 7259f46..19176af 100644 (file)
@@ -83,7 +83,7 @@ mcdiffview_dialog_search (WDiff * dview)
         quick_widget_t quick_widgets[] = {
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (N_("Enter search string:"), input_label_above, INPUT_LAST_TEXT,
-            MC_HISTORY_SHARED_SEARCH, &exp, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+            MC_HISTORY_SHARED_SEARCH, &exp, NULL, FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_SEPARATOR (TRUE),
             QUICK_START_COLUMNS,
                 QUICK_RADIO (num_of_types, (const char **) list_of_types,
index 3a29d9b..59e1dd8 100644 (file)
@@ -2910,7 +2910,7 @@ dview_goto_cmd (WDiff * dview, diff_place_t ord)
 
     input =
         input_dialog (_(title[ord]), _("Enter line:"), MC_HISTORY_YDIFF_GOTO_LINE, prev,
-                      INPUT_COMPLETE_DEFAULT);
+                      INPUT_COMPLETE_NONE);
     if (input != NULL)
     {
         const char *s = input;
index 1795796..0b7c70a 100644 (file)
@@ -463,7 +463,7 @@ edit_get_save_file_as (WEdit * edit)
         quick_widget_t quick_widgets[] = {
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (N_("Enter file name:"), input_label_above,  filename, "save-as",
-                                 &filename_res, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 &filename_res, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
             QUICK_SEPARATOR (TRUE),
             QUICK_LABEL (N_("Change line breaks to:"), NULL),
             QUICK_RADIO (LB_NAMES, lb_names, (int *) &cur_lb, NULL),
@@ -1603,7 +1603,7 @@ edit_save_mode_cmd (void)
             /* *INDENT-OFF* */
             QUICK_RADIO (3, str, &option_save_mode, &edit_save_mode_radio_id),
             QUICK_INPUT (option_backup_ext, "edit-backup-ext", &str_result,
-                         &edit_save_mode_input_id, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                         &edit_save_mode_input_id, FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_SEPARATOR (TRUE),
             QUICK_CHECKBOX (N_("Check &POSIX new line"), &option_check_nl_at_eof, NULL),
             QUICK_BUTTONS_OK_CANCEL,
@@ -1898,7 +1898,7 @@ edit_repeat_macro_cmd (WEdit * edit)
     char *error = NULL;
 
     f = input_dialog (_("Repeat last commands"), _("Repeat times:"), MC_HISTORY_EDIT_REPEAT, NULL,
-                      INPUT_COMPLETE_DEFAULT);
+                      INPUT_COMPLETE_NONE);
     if (f == NULL || *f == '\0')
     {
         g_free (f);
@@ -2064,7 +2064,8 @@ edit_load_cmd (WDialog * h)
     gboolean ret = TRUE;        /* possible cancel */
 
     exp = input_expand_dialog (_("Load"), _("Enter file name:"),
-                               MC_HISTORY_EDIT_LOAD, INPUT_LAST_TEXT, INPUT_COMPLETE_DEFAULT);
+                               MC_HISTORY_EDIT_LOAD, INPUT_LAST_TEXT,
+                               INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD);
 
     if (exp != NULL && *exp != '\0')
     {
@@ -3060,7 +3061,7 @@ edit_goto_cmd (WEdit * edit)
 
     g_snprintf (s, sizeof (s), "%ld", line);
     f = input_dialog (_("Goto line"), _("Enter line:"), MC_HISTORY_EDIT_GOTO_LINE, line ? s : "",
-                      INPUT_COMPLETE_DEFAULT);
+                      INPUT_COMPLETE_NONE);
     if (!f)
         return;
 
@@ -3103,7 +3104,7 @@ edit_save_block_cmd (WEdit * edit)
     tmp = mc_config_get_full_path (EDIT_CLIP_FILE);
     exp =
         input_expand_dialog (_("Save block"), _("Enter file name:"),
-                             MC_HISTORY_EDIT_SAVE_BLOCK, tmp, INPUT_COMPLETE_DEFAULT);
+                             MC_HISTORY_EDIT_SAVE_BLOCK, tmp, INPUT_COMPLETE_FILENAMES);
     g_free (tmp);
     edit_push_undo_action (edit, KEY_PRESS + edit->start_display);
 
@@ -3135,7 +3136,7 @@ edit_insert_file_cmd (WEdit * edit)
 
     tmp = mc_config_get_full_path (EDIT_CLIP_FILE);
     exp = input_expand_dialog (_("Insert file"), _("Enter file name:"),
-                               MC_HISTORY_EDIT_INSERT_FILE, tmp, INPUT_COMPLETE_DEFAULT);
+                               MC_HISTORY_EDIT_INSERT_FILE, tmp, INPUT_COMPLETE_FILENAMES);
     g_free (tmp);
 
     edit_push_undo_action (edit, KEY_PRESS + edit->start_display);
@@ -3181,7 +3182,7 @@ edit_sort_cmd (WEdit * edit)
 
     exp = input_dialog (_("Run sort"),
                         _("Enter sort options (see manpage) separated by whitespace:"),
-                        MC_HISTORY_EDIT_SORT, (old != NULL) ? old : "", INPUT_COMPLETE_DEFAULT);
+                        MC_HISTORY_EDIT_SORT, (old != NULL) ? old : "", INPUT_COMPLETE_NONE);
 
     if (!exp)
         return 1;
@@ -3244,7 +3245,9 @@ edit_ext_cmd (WEdit * edit)
     exp =
         input_dialog (_("Paste output of external command"),
                       _("Enter shell command(s):"), MC_HISTORY_EDIT_PASTE_EXTCMD, NULL,
-                      INPUT_COMPLETE_DEFAULT);
+                      INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_VARIABLES | INPUT_COMPLETE_USERNAMES
+                      | INPUT_COMPLETE_HOSTNAMES | INPUT_COMPLETE_CD | INPUT_COMPLETE_COMMANDS |
+                      INPUT_COMPLETE_SHELL_ESC);
 
     if (!exp)
         return 1;
@@ -3312,13 +3315,13 @@ edit_mail_dialog (WEdit * edit)
         QUICK_LABEL (N_("mail -s <subject> -c <cc> <to>"), NULL),
         QUICK_LABELED_INPUT (N_("To"), input_label_above,
                              mail_to_last != NULL ? mail_to_last : "", "mail-dlg-input-3",
-                             &tmail_to, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                             &tmail_to, NULL, FALSE, FALSE, INPUT_COMPLETE_USERNAMES),
         QUICK_LABELED_INPUT (N_("Subject"), input_label_above,
                               mail_subject_last != NULL ? mail_subject_last : "", "mail-dlg-input-2",
-                              &tmail_subject, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                              &tmail_subject, NULL, FALSE, FALSE, INPUT_COMPLETE_NONE),
         QUICK_LABELED_INPUT (N_("Copies to"), input_label_above,
                              mail_cc_last != NULL ? mail_cc_last  : "", "mail-dlg-input",
-                             &tmail_cc, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                             &tmail_cc, NULL, FALSE, FALSE, INPUT_COMPLETE_USERNAMES),
         QUICK_BUTTONS_OK_CANCEL,
         QUICK_END
         /* *INDENT-ON* */
index 17f2a8b..e706201 100644 (file)
@@ -103,7 +103,7 @@ editcmd_dialog_search_show (WEdit * edit)
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (N_("Enter search string:"), input_label_above, INPUT_LAST_TEXT, 
                                  MC_HISTORY_SHARED_SEARCH, &search_text, NULL, FALSE, FALSE,
-                                 INPUT_COMPLETE_DEFAULT),
+                                 INPUT_COMPLETE_NONE),
             QUICK_SEPARATOR (TRUE),
             QUICK_START_COLUMNS,
                 QUICK_RADIO (num_of_types, (const char **) list_of_types,
@@ -194,9 +194,9 @@ editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const cha
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (N_("Enter search string:"), input_label_above, search_default,
                                  MC_HISTORY_SHARED_SEARCH, search_text, NULL, FALSE, FALSE,
-                                 INPUT_COMPLETE_DEFAULT),
+                                 INPUT_COMPLETE_NONE),
             QUICK_LABELED_INPUT (N_("Enter replacement string:"), input_label_above, replace_default,
-                                 "replace", replace_text, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 "replace", replace_text, NULL, FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_SEPARATOR (TRUE),
             QUICK_START_COLUMNS,
                 QUICK_RADIO (num_of_types, (const char **) list_of_types,
@@ -318,7 +318,7 @@ editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean c
 
     add_widget (raw_dlg, label_new (y, 3, query));
     add_widget (raw_dlg, input_new (y++, 3 + wq + 1, input_get_default_colors (),
-                                    w - (6 + wq + 1), "", 0, INPUT_COMPLETE_DEFAULT));
+                                    w - (6 + wq + 1), "", 0, INPUT_COMPLETE_NONE));
     if (cancel)
     {
         add_widget (raw_dlg, hline_new (y++, -1, -1));
index 08e9719..0c315c7 100644 (file)
@@ -157,7 +157,7 @@ edit_options_dialog (WDialog * h)
                     QUICK_CHECKBOX (N_("Fill tabs with &spaces"), &option_fill_tabs_with_spaces,
                                     NULL),
                     QUICK_LABELED_INPUT (N_("Tab spacing:"), input_label_left, tab_spacing,
-                                          "edit-tab-spacing", &q, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                          "edit-tab-spacing", &q, NULL, FALSE, FALSE, INPUT_COMPLETE_NONE),
                 QUICK_STOP_GROUPBOX,
             QUICK_NEXT_COLUMN,
                 QUICK_START_GROUPBOX (N_("Other options")),
@@ -175,7 +175,7 @@ edit_options_dialog (WDialog * h)
                                      NULL),
                     QUICK_CHECKBOX (N_("&Group undo"), &option_group_undo, NULL),
                     QUICK_LABELED_INPUT (N_("Word wrap line length:"), input_label_left, wrap_length,
-                                         "edit-word-wrap", &p, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                         "edit-word-wrap", &p, NULL, FALSE, FALSE, INPUT_COMPLETE_NONE),
                 QUICK_STOP_GROUPBOX,
             QUICK_STOP_COLUMNS,
             QUICK_BUTTONS_OK_CANCEL,
index e578ab4..1b15267 100644 (file)
@@ -466,7 +466,7 @@ configure_box (void)
                     QUICK_LABELED_INPUT (N_("Timeout:"), input_label_left,
                                          (const char *) time_out, MC_HISTORY_ESC_TIMEOUT,
                                          &time_out_new, &configure_time_out_id, FALSE, FALSE,
-                                         INPUT_COMPLETE_DEFAULT),
+                                         INPUT_COMPLETE_NONE),
                 QUICK_STOP_GROUPBOX,
                 QUICK_START_GROUPBOX (N_("Pause after run")),
                     QUICK_RADIO (pause_options_num, pause_options, &pause_after_run, NULL),
@@ -655,11 +655,11 @@ panel_listing_box (WPanel * panel, char **userp, char **minip, int *use_msformat
             /* *INDENT-OFF* */
             QUICK_RADIO (LIST_TYPES, list_types, &result, &panel_listing_types_id),
             QUICK_INPUT (panel->user_format, "user-fmt-input", &panel_user_format,
-                         &panel_user_format_id, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                         &panel_user_format_id, FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_SEPARATOR (TRUE),
             QUICK_CHECKBOX (N_("User &mini status"), &mini_user_status, &mini_user_status_id),
             QUICK_INPUT (panel->user_status_format[panel->list_type], "mini_input",
-                         &mini_user_format, &mini_user_format_id, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                         &mini_user_format, &mini_user_format_id, FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_BUTTONS_OK_CANCEL,
             QUICK_END
             /* *INDENT-ON* */
@@ -976,19 +976,19 @@ configure_vfs (void)
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (N_("Timeout for freeing VFSs (sec):"), input_label_left,
                                  buffer2, "input-timo-vfs", &ret_timeout, NULL, FALSE, FALSE,
-                                 INPUT_COMPLETE_DEFAULT),
+                                 INPUT_COMPLETE_NONE),
 #ifdef ENABLE_VFS_FTP
             QUICK_SEPARATOR (TRUE),
             QUICK_LABELED_INPUT (N_("FTP anonymous password:"), input_label_left,
                                  ftpfs_anonymous_passwd, "input-passwd", &ret_passwd, NULL,
-                                 FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_LABELED_INPUT (N_("FTP directory cache timeout (sec):"), input_label_left,
                                  buffer3, "input-timeout", &ret_directory_timeout, NULL,
-                                 FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_CHECKBOX (N_("&Always use ftp proxy:"), &ftpfs_always_use_proxy,
                             &ftpfs_always_use_proxy_id),
             QUICK_INPUT (ftpfs_proxy_host, "input-ftp-proxy", &ret_ftp_proxy,
-                         &ftpfs_proxy_host_id, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                         &ftpfs_proxy_host_id, FALSE, FALSE, INPUT_COMPLETE_HOSTNAMES),
             QUICK_CHECKBOX (N_("&Use ~/.netrc"), &ftpfs_use_netrc, NULL),
             QUICK_CHECKBOX (N_("Use &passive mode"), &ftpfs_use_passive_connections, NULL),
             QUICK_CHECKBOX (N_("Use passive mode over pro&xy"),
@@ -1047,7 +1047,7 @@ cd_dialog (void)
 
     quick_widget_t quick_widgets[] = {
         QUICK_LABELED_INPUT (N_("cd"), input_label_left, "", "input", &my_str, NULL, FALSE, TRUE,
-                             INPUT_COMPLETE_DEFAULT),
+                             INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD),
         QUICK_END
     };
 
@@ -1077,10 +1077,10 @@ symlink_dialog (const vfs_path_t * existing_vpath, const vfs_path_t * new_vpath,
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (N_("Existing filename (filename symlink will point to):"),
                                  input_label_above,
-                                 existing, "input-2", ret_existing, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 existing, "input-2", ret_existing, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
             QUICK_SEPARATOR (FALSE),
             QUICK_LABELED_INPUT (N_("Symbolic link filename:"), input_label_above,
-                                 new, "input-1", ret_new, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 new, "input-1", ret_new, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
             QUICK_BUTTONS_OK_CANCEL,
             QUICK_END
             /* *INDENT-ON* */
@@ -1203,11 +1203,11 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain, c
                 QUICK_SEPARATOR (FALSE),
                 QUICK_LABEL (N_("Password:"), NULL),
             QUICK_NEXT_COLUMN,
-                QUICK_INPUT (domain, "auth_domain", &ret_domain, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                QUICK_INPUT (domain, "auth_domain", &ret_domain, NULL, FALSE, FALSE, INPUT_COMPLETE_HOSTNAMES),
                 QUICK_SEPARATOR (FALSE),
-                QUICK_INPUT (user, "auth_name", &ret_user, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                QUICK_INPUT (user, "auth_name", &ret_user, NULL, FALSE, FALSE, INPUT_COMPLETE_USERNAMES),
                 QUICK_SEPARATOR (FALSE),
-                QUICK_INPUT ("", "auth_password", &ret_password, NULL, TRUE, FALSE, INPUT_COMPLETE_DEFAULT),
+                QUICK_INPUT ("", "auth_password", &ret_password, NULL, TRUE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_STOP_COLUMNS,
             QUICK_BUTTONS_OK_CANCEL,
             QUICK_END
index 3df7f49..d504117 100644 (file)
@@ -198,7 +198,7 @@ set_panel_filter (WPanel * p)
     reg_exp = input_dialog_help (_("Filter"),
                                  _("Set expression for filtering filenames"),
                                  "[Filter...]", MC_HISTORY_FM_PANEL_FILTER, x, FALSE,
-                                 INPUT_COMPLETE_DEFAULT);
+                                 INPUT_COMPLETE_FILENAMES);
     if (!reg_exp)
         return;
     set_panel_filter_to (p, reg_exp);
@@ -219,7 +219,8 @@ select_unselect_cmd (const char *title, const char *history_name, gboolean do_se
 
     quick_widget_t quick_widgets[] = {
         /* *INDENT-OFF* */
-        QUICK_INPUT (INPUT_LAST_TEXT, history_name, &reg_exp, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+        QUICK_INPUT (INPUT_LAST_TEXT, history_name, &reg_exp, NULL,
+                     FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
         QUICK_START_COLUMNS,
             QUICK_CHECKBOX (N_("&Files only"), &files_only, NULL),
             QUICK_CHECKBOX (N_("&Using shell patterns"), &shell_patterns, NULL),
@@ -425,7 +426,8 @@ do_link (link_type_t link_type, const char *fname)
     if (link_type == LINK_HARDLINK)
     {
         src = g_strdup_printf (_("Link %s to:"), str_trunc (fname, 46));
-        dest = input_expand_dialog (_("Link"), src, MC_HISTORY_FM_LINK, "", INPUT_COMPLETE_DEFAULT);
+        dest =
+            input_expand_dialog (_("Link"), src, MC_HISTORY_FM_LINK, "", INPUT_COMPLETE_FILENAMES);
         if (!dest || !*dest)
             goto cleanup;
         save_cwds_stat ();
@@ -497,7 +499,8 @@ nice_cd (const char *text, const char *xtext, const char *help,
 
     machine =
         input_dialog_help (text, xtext, help, history_name, "", strip_password,
-                           INPUT_COMPLETE_DEFAULT);
+                           INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD | INPUT_COMPLETE_HOSTNAMES |
+                           INPUT_COMPLETE_USERNAMES);
     if (machine == NULL)
         return;
 
@@ -710,7 +713,7 @@ view_file_cmd (void)
     filename =
         input_expand_dialog (_("View file"), _("Filename:"),
                              MC_HISTORY_FM_VIEW_FILE, selection (current_panel)->fname,
-                             INPUT_COMPLETE_DEFAULT);
+                             INPUT_COMPLETE_FILENAMES);
     if (!filename)
         return;
 
@@ -744,7 +747,8 @@ view_filtered_cmd (void)
     command =
         input_dialog (_("Filtered view"),
                       _("Filter command and arguments:"),
-                      MC_HISTORY_FM_FILTERED_VIEW, initial_command, INPUT_COMPLETE_DEFAULT);
+                      MC_HISTORY_FM_FILTERED_VIEW, initial_command,
+                      INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_COMMANDS);
 
     if (command != NULL)
     {
@@ -829,7 +833,7 @@ edit_cmd_new (void)
         char *fname;
 
         fname = input_expand_dialog (_("Edit file"), _("Enter file name:"),
-                                     MC_HISTORY_EDIT_LOAD, "");
+                                     MC_HISTORY_EDIT_LOAD, "", INPUT_COMPLETE_FILENAMES);
         if (fname == NULL)
             return;
 
@@ -918,7 +922,7 @@ mkdir_cmd (void)
     dir =
         input_expand_dialog (_("Create a new Directory"),
                              _("Enter directory name:"), MC_HISTORY_FM_MKDIR, name,
-                             INPUT_COMPLETE_DEFAULT);
+                             INPUT_COMPLETE_FILENAMES);
 
     if (dir != NULL && dir != '\0')
     {
@@ -1356,7 +1360,7 @@ edit_symlink_cmd (void)
             buffer[i] = 0;
             dest =
                 input_expand_dialog (_("Edit symlink"), q, MC_HISTORY_FM_EDIT_LINK, buffer,
-                                     INPUT_COMPLETE_DEFAULT);
+                                     INPUT_COMPLETE_FILENAMES);
             if (dest)
             {
                 if (*dest && strcmp (buffer, dest))
index 4cb1973..00d787d 100644 (file)
@@ -476,7 +476,8 @@ command_new (int y, int x, int cols)
     };
 
     cmd = input_new (y, x, (int *) command_colors, cols, "", "cmdline",
-                     INPUT_COMPLETE_DEFAULT | INPUT_COMPLETE_CD | INPUT_COMPLETE_COMMANDS |
+                     INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_VARIABLES | INPUT_COMPLETE_USERNAMES
+                     | INPUT_COMPLETE_HOSTNAMES | INPUT_COMPLETE_CD | INPUT_COMPLETE_COMMANDS |
                      INPUT_COMPLETE_SHELL_ESC);
 
     /* Add our hooks */
index 375373a..b022dcb 100644 (file)
@@ -229,7 +229,7 @@ exec_make_shell_string (const char *lc_data, const vfs_path_t * filename_vpath)
                 parameter_found = FALSE;
                 parameter =
                     input_dialog (_("Parameter"), lc_prompt, MC_HISTORY_EXT_PARAMETER, "",
-                                  INPUT_COMPLETE_DEFAULT);
+                                  INPUT_COMPLETE_NONE);
                 if (parameter == NULL)
                 {
                     /* User canceled */
index 304ccb8..57eff73 100644 (file)
@@ -1181,14 +1181,14 @@ file_mask_dialog (FileOpContext * ctx, FileOperation operation,
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (fmd_buf, input_label_above,
                                  easy_patterns ? "*" : "^(.*)$", "input-def", &source_mask,
-                                 NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
             QUICK_START_COLUMNS,
                 QUICK_SEPARATOR (FALSE),
             QUICK_NEXT_COLUMN,
                 QUICK_CHECKBOX (N_("&Using shell patterns"), &source_easy_patterns, NULL),
             QUICK_STOP_COLUMNS,
             QUICK_LABELED_INPUT (N_("to:"), input_label_above,
-                                 def_text_secure, "input2", &dest_dir, NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 def_text_secure, "input2", &dest_dir, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES),
             QUICK_SEPARATOR (TRUE),
             QUICK_START_COLUMNS,
                 QUICK_CHECKBOX (N_("Follow &links"), &ctx->follow_links, NULL),
index 8091299..7b8b728 100644 (file)
@@ -609,7 +609,7 @@ find_parameters (char **start_dir, ssize_t * start_dir_len,
     add_widget (find_dlg, label_new (y1++, x1, _("Start at:")));
     in_start =
         input_new (y1, x1, input_get_default_colors (), cols - b0 - 7, in_start_dir, "start",
-                   INPUT_COMPLETE_DEFAULT);
+                   INPUT_COMPLETE_CD | INPUT_COMPLETE_FILENAMES);
     add_widget (find_dlg, in_start);
 
     add_widget (find_dlg, button_new (y1++, cols - b0 - 3, B_TREE, NORMAL_BUTTON, buts[0], NULL));
@@ -621,7 +621,7 @@ find_parameters (char **start_dir, ssize_t * start_dir_len,
     in_ignore =
         input_new (y1++, x1, input_get_default_colors (), cols - 6,
                    options.ignore_dirs != NULL ? options.ignore_dirs : "", "ignoredirs",
-                   INPUT_COMPLETE_DEFAULT);
+                   INPUT_COMPLETE_CD | INPUT_COMPLETE_FILENAMES);
     widget_disable (WIDGET (in_ignore), !options.ignore_dirs_enable);
     add_widget (find_dlg, in_ignore);
 
@@ -633,7 +633,7 @@ find_parameters (char **start_dir, ssize_t * start_dir_len,
     add_widget (find_dlg, label_new (y1++, x1, file_name_label));
     in_name =
         input_new (y1++, x1, input_get_default_colors (), cw, INPUT_LAST_TEXT, "name",
-                   INPUT_COMPLETE_DEFAULT);
+                   INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD);
     add_widget (find_dlg, in_name);
 
     /* Start 2nd column */
@@ -641,7 +641,7 @@ find_parameters (char **start_dir, ssize_t * start_dir_len,
     add_widget (find_dlg, content_label);
     in_with =
         input_new (y2++, x2, input_get_default_colors (), cw, INPUT_LAST_TEXT,
-                   MC_HISTORY_SHARED_SEARCH, INPUT_COMPLETE_DEFAULT);
+                   MC_HISTORY_SHARED_SEARCH, INPUT_COMPLETE_NONE);
     in_with->label = content_label;
     widget_disable (WIDGET (in_with), disable);
     add_widget (find_dlg, in_with);
index aed530d..dbfd5cc 100644 (file)
@@ -961,10 +961,10 @@ add_new_entry_input (const char *header, const char *text1, const char *text2,
     quick_widget_t quick_widgets[] = {
         /* *INDENT-OFF* */
         QUICK_LABELED_INPUT (text1, input_label_above, *r1, "input-lbl", r1, NULL,
-                             FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                             FALSE, FALSE, INPUT_COMPLETE_NONE),
         QUICK_SEPARATOR (FALSE),
         QUICK_LABELED_INPUT (text2, input_label_above, *r2, "input-lbl", r2, NULL,
-                             FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                             FALSE, FALSE, INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD),
         QUICK_START_BUTTONS (TRUE, TRUE),
             QUICK_BUTTON (N_("&Append"), B_APPEND, NULL, NULL),
             QUICK_BUTTON (N_("&Insert"), B_INSERT, NULL, NULL),
@@ -1026,7 +1026,7 @@ add_new_group_input (const char *header, const char *label, char **result)
     quick_widget_t quick_widgets[] = {
         /* *INDENT-OFF* */
         QUICK_LABELED_INPUT (label, input_label_above, "", "input", result, NULL,
-                             FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                             FALSE, FALSE, INPUT_COMPLETE_NONE),
         QUICK_START_BUTTONS (TRUE, TRUE),
             QUICK_BUTTON (N_("&Append"), B_APPEND, NULL, NULL),
             QUICK_BUTTON (N_("&Insert"), B_INSERT, NULL, NULL),
@@ -1570,7 +1570,7 @@ add2hotlist_cmd (void)
     lc_prompt = g_strdup_printf (cp, str_trunc (label_string, COLS - 2 * UX - (l + 8)));
     label =
         input_dialog (_("Add to hotlist"), lc_prompt, MC_HISTORY_HOTLIST_ADD, label_string,
-                      INPUT_COMPLETE_DEFAULT);
+                      INPUT_COMPLETE_NONE);
     g_free (lc_prompt);
 
     if (label == NULL || *label == '\0')
index f4ea442..5c39a7d 100644 (file)
@@ -186,9 +186,13 @@ init_panelize (void)
     add_widget (panelize_dlg, label_new (y++, UX, _("Command")));
     pname =
         input_new (y++, UX, input_get_default_colors (), panelize_cols - UX * 2, "", "in",
-                   INPUT_COMPLETE_DEFAULT);
+                   INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_HOSTNAMES | INPUT_COMPLETE_COMMANDS |
+                   INPUT_COMPLETE_VARIABLES | INPUT_COMPLETE_USERNAMES | INPUT_COMPLETE_CD |
+                   INPUT_COMPLETE_SHELL_ESC);
     add_widget (panelize_dlg, pname);
 
+
+
     add_widget (panelize_dlg, hline_new (y++, -1, -1));
 
     x = (panelize_cols - blen) / 2;
@@ -259,7 +263,7 @@ add2panelize_cmd (void)
     {
         label = input_dialog (_("Add to external panelize"),
                               _("Enter command label:"), MC_HISTORY_FM_PANELIZE_ADD, "",
-                              INPUT_COMPLETE_DEFAULT);
+                              INPUT_COMPLETE_NONE);
         if (!label)
             return;
         if (!*label)
index f6384d3..628e120 100644 (file)
@@ -785,7 +785,8 @@ tree_copy (WTree * tree, const char *default_dest)
     g_snprintf (msg, sizeof (msg), _("Copy \"%s\" directory to:"),
                 str_trunc (selected_ptr_name, 50));
     dest = input_expand_dialog (Q_ ("DialogTitle|Copy"),
-                                msg, MC_HISTORY_FM_TREE_COPY, default_dest, INPUT_COMPLETE_DEFAULT);
+                                msg, MC_HISTORY_FM_TREE_COPY, default_dest,
+                                INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD);
 
     if (dest != NULL && *dest != '\0')
     {
@@ -825,7 +826,7 @@ tree_move (WTree * tree, const char *default_dest)
                 str_trunc (selected_ptr_name, 50));
     dest =
         input_expand_dialog (Q_ ("DialogTitle|Move"), msg, MC_HISTORY_FM_TREE_MOVE, default_dest,
-                             INPUT_COMPLETE_DEFAULT);
+                             INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD);
 
     if (dest == NULL || *dest == '\0')
         goto ret;
index 854b681..ea8ede4 100644 (file)
@@ -475,7 +475,9 @@ execute_menu_command (WEdit * edit_widget, const char *commands, gboolean show_p
                 *parameter = 0;
                 parameter =
                     input_dialog (_("Parameter"), lc_prompt, MC_HISTORY_FM_MENU_EXEC_PARAM, "",
-                                  INPUT_COMPLETE_DEFAULT);
+                                  INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_CD |
+                                  INPUT_COMPLETE_HOSTNAMES | INPUT_COMPLETE_VARIABLES |
+                                  INPUT_COMPLETE_USERNAMES);
                 if (!parameter || !*parameter)
                 {
                     /* User canceled */
index b7e6625..c16b3e1 100644 (file)
@@ -655,7 +655,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, const char
                 p = g_strdup_printf (_("FTP: Account required for user %s"),
                                      super->path_element->user);
                 op = input_dialog (p, _("Account:"), MC_HISTORY_FTPFS_ACCOUNT, "",
-                                   INPUT_COMPLETE_DEFAULT);
+                                   INPUT_COMPLETE_USERNAMES);
                 g_free (p);
                 if (op == NULL)
                     ERRNOR (EPERM, 0);
index 125b63b..8fba696 100644 (file)
@@ -89,7 +89,7 @@ mcview_dialog_search (mcview_t * view)
             /* *INDENT-OFF* */
             QUICK_LABELED_INPUT (N_("Enter search string:"), input_label_above,
                                  INPUT_LAST_TEXT, MC_HISTORY_SHARED_SEARCH, &exp,
-                                 NULL, FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                                 NULL, FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_SEPARATOR (TRUE),
             QUICK_START_COLUMNS,
                 QUICK_RADIO (num_of_types, (const char **) list_of_types,
@@ -199,7 +199,7 @@ mcview_dialog_goto (mcview_t * view, off_t * offset)
         quick_widget_t quick_widgets[] = {
             /* *INDENT-OFF* */
             QUICK_INPUT (INPUT_LAST_TEXT, MC_HISTORY_VIEW_GOTO, &exp, NULL,
-                         FALSE, FALSE, INPUT_COMPLETE_DEFAULT),
+                         FALSE, FALSE, INPUT_COMPLETE_NONE),
             QUICK_RADIO (num_of_types, (const char **) mc_view_goto_str, (int *) &current_goto_type,
                          NULL),
             QUICK_BUTTONS_OK_CANCEL,
index 656f157..d811d24 100644 (file)
@@ -115,56 +115,56 @@ static const struct test_complete_engine_fill_completions_ds
     {
         "string",
         3,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         0,
         3
     },
     {
         "some string",
         7,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         5,
         7
     },
     {
         "some\tstring",
         7,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         5,
         7
     },
     {
         "some;string",
         7,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         5,
         7
     },
     {
         "some|string",
         7,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         5,
         7
     },
     {
         "some<string",
         7,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         5,
         7
     },
     {
         "some>string",
         7,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         5,
         7
     },
     {
         "some!@#$%^&*()_\\+~`\"',./?:string",
         30,
-        INPUT_COMPLETE_DEFAULT,
+        INPUT_COMPLETE_NONE,
         0,
         30
     },