diff options
author | Henrik Aarnio <hjaarnio@gmail.com> | 2013-11-22 17:35:34 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-11-22 17:48:46 +0400 |
commit | 9c5fb7b2e7ecb0271371cd729808da44c3bc1bc3 (patch) | |
tree | 60782e733753c780d2608f2ceca3197b71d612fb /source/blender/editors/space_file/filesel.c | |
parent | e3a79258d17e6cdca26120eab7a2c48c7c4d4a0f (diff) |
Fix T37485: autocomplete while appending and autocomplete folder behaviour.
This adds functionality to tab-autocomplete folders in the file browser file
field, and the ability to autocomplete .blend files and their sub folders while
linking. If only one match of a blend or a folder is found, it is opened, which
applies to wildcards in the file field now.
Reviewed By: elubie, brecht
Differential Revision: http://developer.blender.org/D20
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index c6e1541352d..3cda5dd5e80 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -627,7 +627,7 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matche if (!match) { BLI_strncpy(matched_file, file->relname, FILE_MAX); } - match = 1; + match++; } } @@ -700,13 +700,13 @@ bool autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v)) for (i = 0; i < nentries; ++i) { struct direntry *file = filelist_file(sfile->files, i); - if (file && S_ISREG(file->type)) { + if (file && (S_ISREG(file->type) || S_ISDIR(file->type))) { autocomplete_do_name(autocpl, file->relname); } } match = autocomplete_end(autocpl, str); } - return match != AUTOCOMPLETE_NO_MATCH; + return match == AUTOCOMPLETE_FULL_MATCH; } void ED_fileselect_clear(struct wmWindowManager *wm, struct SpaceFile *sfile) |