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.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index b9ff423..89c9d26 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6678,9 +6678,7 @@
ex_splitview(exarg_T *eap)
{
win_T *old_curwin = curwin;
-#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
char_u *fname = NULL;
-#endif
#ifdef FEAT_BROWSE
char_u dot_path[] = ".";
int save_cmod_flags = cmdmod.cmod_flags;
@@ -6708,7 +6706,6 @@
}
#endif
-#ifdef FEAT_SEARCHPATH
if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind)
{
fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg),
@@ -6718,11 +6715,7 @@
eap->arg = fname;
}
# ifdef FEAT_BROWSE
- else
-# endif
-#endif
-#ifdef FEAT_BROWSE
- if ((cmdmod.cmod_flags & CMOD_BROWSE)
+ else if ((cmdmod.cmod_flags & CMOD_BROWSE)
&& eap->cmdidx != CMD_vnew
&& eap->cmdidx != CMD_new)
{
@@ -6786,10 +6779,8 @@
cmdmod.cmod_flags = save_cmod_flags;
# endif
-# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
theend:
vim_free(fname);
-# endif
}
/*
@@ -6980,7 +6971,6 @@
static void
ex_find(exarg_T *eap)
{
-#ifdef FEAT_SEARCHPATH
char_u *fname;
int count;
@@ -7002,12 +6992,9 @@
if (fname != NULL)
{
eap->arg = fname;
-#endif
do_exedit(eap, NULL);
-#ifdef FEAT_SEARCHPATH
vim_free(fname);
}
-#endif
}
/*
@@ -9273,7 +9260,6 @@
}
break;
-#ifdef FEAT_SEARCHPATH
case SPEC_CFILE: // file name under cursor
result = file_name_at_cursor(FNAME_MESS|FNAME_HYP, 1L, NULL);
if (result == NULL)
@@ -9283,7 +9269,6 @@
}
resultbuf = result; // remember allocated string
break;
-#endif
case SPEC_AFILE: // file name for autocommand
result = autocmd_fname;