diff src/eval.c @ 16427:8c3a1bd270bb v8.1.1218

patch 8.1.1218: cannot set a directory for a tab page commit https://github.com/vim/vim/commit/00aa069db8132851a91cfc5ca7f58ef945c75c73 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 27 20:37:57 2019 +0200 patch 8.1.1218: cannot set a directory for a tab page Problem: Cannot set a directory for a tab page. Solution: Add the tab-local directory. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4212)
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Apr 2019 20:45:05 +0200
parents 5b5c5daf57de
children 6e87a69b8e0c
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -8704,11 +8704,13 @@ find_win_by_nr_or_id(typval_T *vp)
 
 /*
  * Find window specified by "wvp" in tabpage "tvp".
+ * Returns the tab page in 'ptp'
  */
     win_T *
 find_tabwin(
-    typval_T	*wvp,	/* VAR_UNKNOWN for current window */
-    typval_T	*tvp)	/* VAR_UNKNOWN for current tab page */
+    typval_T	*wvp,	// VAR_UNKNOWN for current window
+    typval_T	*tvp,	// VAR_UNKNOWN for current tab page
+    tabpage_T	**ptp)
 {
     win_T	*wp = NULL;
     tabpage_T	*tp = NULL;
@@ -8726,10 +8728,22 @@ find_tabwin(
 	    tp = curtab;
 
 	if (tp != NULL)
+	{
 	    wp = find_win_by_nr(wvp, tp);
+	    if (wp == NULL && wvp->v_type == VAR_NUMBER
+						&& wvp->vval.v_number != -1)
+		// A window with the specified number is not found
+		tp = NULL;
+	}
     }
     else
+    {
 	wp = curwin;
+	tp = curtab;
+    }
+
+    if (ptp != NULL)
+	*ptp = tp;
 
     return wp;
 }