Mercurial > vim
comparison src/misc2.c @ 29853:31c598083364 v9.0.0265
patch 9.0.0265: no good reason why the "gf" command isn't in the tiny version
Commit: https://github.com/vim/vim/commit/f80f40a55ccff0a4331c5fbd1ac446511f622ed0
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 25 16:02:23 2022 +0100
patch 9.0.0265: no good reason why the "gf" command isn't in the tiny version
Problem: No good reason why the "gf" command is not in the tiny version.
Solution: Graduate the file_in_path feature.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 25 Aug 2022 17:15:03 +0200 |
parents | bc6cf208b1b4 |
children | ed6f3d2593df |
comparison
equal
deleted
inserted
replaced
29852:8568b72caa9a | 29853:31c598083364 |
---|---|
2397 | 2397 |
2398 #endif // CURSOR_SHAPE | 2398 #endif // CURSOR_SHAPE |
2399 | 2399 |
2400 | 2400 |
2401 /* | 2401 /* |
2402 * Change directory to "new_dir". If FEAT_SEARCHPATH is defined, search | 2402 * Change directory to "new_dir". Search 'cdpath' for relative directory |
2403 * 'cdpath' for relative directory names, otherwise just mch_chdir(). | 2403 * names, otherwise just mch_chdir(). |
2404 */ | 2404 */ |
2405 int | 2405 int |
2406 vim_chdir(char_u *new_dir) | 2406 vim_chdir(char_u *new_dir) |
2407 { | 2407 { |
2408 #ifndef FEAT_SEARCHPATH | |
2409 return mch_chdir((char *)new_dir); | |
2410 #else | |
2411 char_u *dir_name; | 2408 char_u *dir_name; |
2412 int r; | 2409 int r; |
2413 | 2410 |
2414 dir_name = find_directory_in_path(new_dir, (int)STRLEN(new_dir), | 2411 dir_name = find_directory_in_path(new_dir, (int)STRLEN(new_dir), |
2415 FNAME_MESS, curbuf->b_ffname); | 2412 FNAME_MESS, curbuf->b_ffname); |
2416 if (dir_name == NULL) | 2413 if (dir_name == NULL) |
2417 return -1; | 2414 return -1; |
2418 r = mch_chdir((char *)dir_name); | 2415 r = mch_chdir((char *)dir_name); |
2419 vim_free(dir_name); | 2416 vim_free(dir_name); |
2420 return r; | 2417 return r; |
2421 #endif | |
2422 } | 2418 } |
2423 | 2419 |
2424 /* | 2420 /* |
2425 * Get user name from machine-specific function. | 2421 * Get user name from machine-specific function. |
2426 * Returns the user name in "buf[len]". | 2422 * Returns the user name in "buf[len]". |