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/ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ring.c') diff --git a/src/ring.c b/src/ring.c index bc30e8e..5a9e74e 100644 --- a/src/ring.c +++ b/src/ring.c @@ -512,7 +512,7 @@ teco_state_edit_file_done(teco_machine_main_t *ctx, const teco_string_t *str, GE * A value of 1 denotes the first buffer, 2 the second, * ecetera. */ -TECO_DEFINE_STATE_EXPECTFILE(teco_state_edit_file, +TECO_DEFINE_STATE_EXPECTGLOB(teco_state_edit_file, .initial_cb = (teco_state_initial_cb_t)teco_state_edit_file_initial ); -- cgit v1.2.3