diff options
author | Florian Walch <florian@fwalch.com> | 2016-02-09 22:26:30 +0100 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2016-02-09 22:26:30 +0100 |
commit | dcdb50b64b898b64e3cb4ce05d0a2c3152740e3b (patch) | |
tree | 0eddf125fd8a1e0d94ffa279134669df1ee5fbf7 /src/nvim/eval.c | |
parent | 3be74ac634e205e26874f75b9300d3e016a110d6 (diff) | |
parent | f19e4dd1df63d8185631107d1def1609dc5aad7a (diff) | |
download | rneovim-dcdb50b64b898b64e3cb4ce05d0a2c3152740e3b.tar.gz rneovim-dcdb50b64b898b64e3cb4ce05d0a2c3152740e3b.tar.bz2 rneovim-dcdb50b64b898b64e3cb4ce05d0a2c3152740e3b.zip |
Merge pull request #4212 from jbradaric/vim-7.4.834
vim-patch:7.4.834
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 7ca1f1512e..b9b913a969 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10593,9 +10593,10 @@ static void f_gettabvar(typval_T *argvars, typval_T *rettv) varname = get_tv_string_chk(&argvars[1]); tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); if (tp != NULL && varname != NULL) { - /* Set tp to be our tabpage, temporarily. Also set the window to the - * first window in the tabpage, otherwise the window is not valid. */ - if (switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE) == OK) { + // Set tp to be our tabpage, temporarily. Also set the window to the + // first window in the tabpage, otherwise the window is not valid. + win_T *window = tp->tp_firstwin == NULL ? firstwin : tp->tp_firstwin; + if (switch_win(&oldcurwin, &oldtabpage, window, tp, true) == OK) { // look up the variable // Let gettabvar({nr}, "") return the "t:" dictionary. v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE); |