diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-26 07:37:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-26 07:37:57 +0800 |
commit | c12f6002a15b27ada972b997bc0950f37d06027d (patch) | |
tree | 5d38ca02ea5ca71cbd73e507adca43a44d2c9f89 /src/nvim/file_search.c | |
parent | 6e9980fc3b6f8e246632aef0f4b8c0edf30e24f0 (diff) | |
parent | 207fe4810e893bd4b777e4e3b212055e8dfb05ac (diff) | |
download | rneovim-c12f6002a15b27ada972b997bc0950f37d06027d.tar.gz rneovim-c12f6002a15b27ada972b997bc0950f37d06027d.tar.bz2 rneovim-c12f6002a15b27ada972b997bc0950f37d06027d.zip |
Merge pull request #19950 from zeertzjq/vim-9.0.0270
vim-patch:9.0.{0262,0263,0266,0268,0270}: too many #ifdefs
Diffstat (limited to 'src/nvim/file_search.c')
-rw-r--r-- | src/nvim/file_search.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 2e86e3f7b0..0eb6ad50ff 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -110,16 +110,15 @@ typedef struct ff_stack { typedef struct ff_visited { struct ff_visited *ffv_next; - /* Visited directories are different if the wildcard string are - * different. So we have to save it. - */ + // Visited directories are different if the wildcard string are + // different. So we have to save it. char_u *ffv_wc_path; + // use FileID for comparison (needed because of links), else use filename. bool file_id_valid; FileID file_id; - /* The memory for this struct is allocated according to the length of - * ffv_fname. - */ + // The memory for this struct is allocated according to the length of + // ffv_fname. char_u ffv_fname[1]; // actually longer } ff_visited_T; @@ -510,9 +509,7 @@ void *vim_findfile_init(char_u *path, char_u *filename, char_u *stopdirs, int le xfree(buf); } - sptr = ff_create_stack_element(ff_expand_buffer, - search_ctx->ffsc_wc_path, - level, 0); + sptr = ff_create_stack_element(ff_expand_buffer, search_ctx->ffsc_wc_path, level, 0); ff_push(search_ctx, sptr); search_ctx->ffsc_file_to_search = vim_strsave(filename); @@ -641,11 +638,8 @@ char_u *vim_findfile(void *search_ctx_arg) * first time (hence stackp->ff_filearray == NULL) */ if (stackp->ffs_filearray == NULL - && ff_check_visited(&search_ctx->ffsc_dir_visited_list - ->ffvl_visited_list, - stackp->ffs_fix_path, - stackp->ffs_wc_path - ) == FAIL) { + && ff_check_visited(&search_ctx->ffsc_dir_visited_list->ffvl_visited_list, + stackp->ffs_fix_path, stackp->ffs_wc_path) == FAIL) { #ifdef FF_VERBOSE if (p_verbose >= 5) { verbose_enter_scroll(); @@ -790,8 +784,7 @@ char_u *vim_findfile(void *search_ctx_arg) stackp->ffs_filearray_cur = 0; stackp->ffs_stage = 0; } else { - rest_of_wildcards = &stackp->ffs_wc_path[ - STRLEN(stackp->ffs_wc_path)]; + rest_of_wildcards = &stackp->ffs_wc_path[STRLEN(stackp->ffs_wc_path)]; } if (stackp->ffs_stage == 0) { @@ -833,23 +826,17 @@ char_u *vim_findfile(void *search_ctx_arg) // if file exists and we didn't already find it if ((path_with_url((char *)file_path) || (os_path_exists(file_path) - && (search_ctx->ffsc_find_what - == FINDFILE_BOTH - || ((search_ctx->ffsc_find_what - == FINDFILE_DIR) + && (search_ctx->ffsc_find_what == FINDFILE_BOTH + || ((search_ctx->ffsc_find_what == FINDFILE_DIR) == os_isdir(file_path))))) #ifndef FF_VERBOSE && (ff_check_visited(&search_ctx->ffsc_visited_list->ffvl_visited_list, - file_path, - (char_u *)"" - ) == OK) + file_path, (char_u *)"") == OK) #endif ) { #ifdef FF_VERBOSE if (ff_check_visited(&search_ctx->ffsc_visited_list->ffvl_visited_list, - file_path, - (char_u *)"" - ) == FAIL) { + file_path, (char_u *)"") == FAIL) { if (p_verbose >= 5) { verbose_enter_scroll(); smsg("Already: %s", file_path); |