From fcacbbf772948665ff187660b723476a383d6586 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 9 Jan 2015 04:27:15 +0000
Subject: [PATCH] When selecting files, start in the files pane.  When
 selecting dirs, start in the dir pane.

---
 src/uifc/filepick.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/uifc/filepick.c b/src/uifc/filepick.c
index 54e105780e..ba52ce7335 100644
--- a/src/uifc/filepick.c
+++ b/src/uifc/filepick.c
@@ -297,8 +297,8 @@ int filepick(uifcapi_t *api, char *title, struct file_pick *fp, char *dir, char
 	int		listwidth;
 	char	**dir_list=NULL;
 	char	**file_list=NULL;
-	int		currfield=DIR_LIST;
-	int		lastfield=DIR_LIST;
+	int		currfield;
+	int		lastfield;
 	int		i;
 	int		root=0;						/* Is this the root of the file system? */
 										/* On *nix, this just means no .. on Win32,
@@ -331,6 +331,11 @@ int filepick(uifcapi_t *api, char *title, struct file_pick *fp, char *dir, char
 	if((opts & UIFC_FP_MULTI)==UIFC_FP_MULTI && (opts & (UIFC_FP_ALLOWENTRY|UIFC_FP_OVERPROMPT|UIFC_FP_CREATPROMPT)))
 		return(-1);
 
+	if (opts & UIFC_FP_DIRSEL)
+		currfield = lastfield = DIR_LIST;
+	else
+		currfield = lastfield = FILE_LIST;
+
 	fp->files=0;
 	fp->selected=NULL;
 
-- 
GitLab