From cc63f3b25cd449573fe9b6b7d0c88f5dd0ed2f4d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 11 Sep 2024 16:01:51 +0200 Subject: improved file name autocompletion * pressing ^W in FG now deletes the entire directory component as in EB * commands without glob patterns (eg. EW) can now autocomplete file names containing glob patterns * When the autocompletion contains a glob character in commands accepting glob patterns like EB or EN, we now escape the glob pattern. This already helps if the remaining file name can be autocompleted in one go. Unfortunately, this is still insufficient if we can only partially complete and the partial completion contains glob characters. For instance, if there are 2 files: `file?.txt` and `file?.foo`, completing after `f` will insert `ile[?].`. The second try to press Tab will already do nothing. To fully support these cases, we need a version of teco_file_auto_complete() accepting glob patterns. Perhaps we can simply append `*` to the given glob pattern. --- src/file-utils.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/file-utils.c') diff --git a/src/file-utils.c b/src/file-utils.c index 0909d7a..3f8f721 100644 --- a/src/file-utils.c +++ b/src/file-utils.c @@ -37,7 +37,6 @@ #include "sciteco.h" #include "qreg.h" -#include "glob.h" #include "interface.h" #include "string-utils.h" #include "file-utils.h" @@ -237,9 +236,6 @@ teco_file_auto_complete(const gchar *filename, GFileTest file_test, teco_string_ { memset(insert, 0, sizeof(*insert)); - if (teco_globber_is_pattern(filename)) - return FALSE; - g_autofree gchar *filename_expanded = teco_file_expand_path(filename); gsize filename_len = strlen(filename_expanded); -- cgit v1.2.3