To: vim_dev@googlegroups.com Subject: Patch 7.4.834 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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) Files: src/eval.c, src/testdir/test91.in, src/testdir/test91.ok *** ../vim-7.4.833/src/eval.c 2015-08-13 23:28:38.242878357 +0200 --- src/eval.c 2015-08-25 16:14:37.962043098 +0200 *************** *** 12291,12297 **** { /* 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) { /* look up the variable */ --- 12291,12298 ---- { /* 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 == NULL ? firstwin : tp->tp_firstwin, tp, TRUE) == OK) { /* look up the variable */ *** ../vim-7.4.833/src/testdir/test91.in 2014-09-09 16:13:05.040531695 +0200 --- src/testdir/test91.in 2015-08-25 16:14:21.978209619 +0200 *************** *** 5,12 **** :so small.vim :so mbyte.vim :" - :" Test for getbufvar() :" Use strings to test for memory leaks. :let b:var_num = '1234' :let def_num = '5678' :$put =string(getbufvar(1, 'var_num')) --- 5,16 ---- :so small.vim :so mbyte.vim :" :" 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 def_num = '5678' :$put =string(getbufvar(1, 'var_num')) *** ../vim-7.4.833/src/testdir/test91.ok 2014-09-09 16:13:05.040531695 +0200 --- src/testdir/test91.ok 2015-08-25 16:14:21.978209619 +0200 *************** *** 1,4 **** --- 1,6 ---- start: + 'abcd' + 'abcd' '1234' '1234' {'var_num': '1234'} *** ../vim-7.4.833/src/version.c 2015-08-25 15:39:51.459826645 +0200 --- src/version.c 2015-08-25 16:14:09.318341510 +0200 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 834, /**/ -- A special law prohibits unmarried women from parachuting on Sunday or she shall risk arrest, fine, and/or jailing. [real standing law in Florida, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///