diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-04-27 20:37:57 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-04-27 20:37:57 +0200 |
commit | 00aa069db8132851a91cfc5ca7f58ef945c75c73 (patch) | |
tree | 54e88e9f1c4a981eb265015eabdc2cde2931cc5e /src/eval.c | |
parent | 2155a6abaa5d065ad7b580229321860591126f2e (diff) | |
download | vim-git-00aa069db8132851a91cfc5ca7f58ef945c75c73.tar.gz |
patch 8.1.1218: cannot set a directory for a tab pagev8.1.1218
Problem: Cannot set a directory for a tab page.
Solution: Add the tab-local directory. (Yegappan Lakshmanan, closes #4212)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index a1ad0e673..0a1690026 100644 --- 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; } |