0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.834

Problem:    gettabvar() doesn't work after Vim start. (Szymon Wrozynski)
Solution:   Handle first window in tab still being NULL. (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2015-08-25 16:19:05 +02:00
parent e68c25c677
commit 7e47d1ac6a
4 changed files with 11 additions and 2 deletions

View File

@@ -12291,7 +12291,8 @@ f_gettabvar(argvars, rettv)
{ {
/* Set tp to be our tabpage, temporarily. Also set the window to the /* Set tp to be our tabpage, temporarily. Also set the window to the
* first window in the tabpage, otherwise the window is not valid. */ * first window in the tabpage, otherwise the window is not valid. */
if (switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE) if (switch_win(&oldcurwin, &oldtabpage,
tp->tp_firstwin == NULL ? firstwin : tp->tp_firstwin, tp, TRUE)
== OK) == OK)
{ {
/* look up the variable */ /* look up the variable */

View File

@@ -5,8 +5,12 @@ STARTTEST
:so small.vim :so small.vim
:so mbyte.vim :so mbyte.vim
:" :"
:" Test for getbufvar()
:" Use strings to test for memory leaks. :" Use strings to test for memory leaks.
:" First, check that in an empty window, gettabvar() returns the correct value
:let t:testvar='abcd'
:$put =string(gettabvar(1,'testvar'))
:$put =string(gettabvar(1,'testvar'))
:" Test for getbufvar()
:let b:var_num = '1234' :let b:var_num = '1234'
:let def_num = '5678' :let def_num = '5678'
:$put =string(getbufvar(1, 'var_num')) :$put =string(getbufvar(1, 'var_num'))

View File

@@ -1,4 +1,6 @@
start: start:
'abcd'
'abcd'
'1234' '1234'
'1234' '1234'
{'var_num': '1234'} {'var_num': '1234'}

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
834,
/**/ /**/
833, 833,
/**/ /**/