Tabcomp and hidden files
authorColin Clark <colin.clark@cclark.uk>
Thu, 28 Jun 2018 18:22:21 +0000 (19:22 +0100)
committerColin Clark <colin.clark@cclark.uk>
Thu, 28 Jun 2018 18:22:21 +0000 (19:22 +0100)
Make tabcomp follow the "Show hidden files or folders" option

src/ui_tabcomp.c

index c3fff00..511071c 100644 (file)
@@ -136,7 +136,8 @@ static void tab_completion_read_dir(TabCompData *td, const gchar *path)
        while ((dir = readdir(dp)) != NULL)
                {
                gchar *name = dir->d_name;
-               if (strcmp(name, ".") != 0 && strcmp(name, "..") != 0)
+               if (strcmp(name, ".") != 0 && strcmp(name, "..") != 0 &&
+                                               (name[0] != '.' || options->file_filter.show_hidden_files))
                        {
                        gchar *abspath = g_build_filename(pathl, name, NULL);