home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.4 / 7.4.434 < prev    next >
Encoding:
Internet Message Format  |  2014-09-09  |  4.0 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.434
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.434
  11. Problem:    gettabvar() is not consistent with getwinvar() and getbufvar().
  12. Solution:   Return a dict with all variables when the varname is empty.
  13.         (Yasuhiro Matsumoto)
  14. Files:        src/eval.c, runtime/doc/eval.txt, src/testdir/test91.in,
  15.         src/testdir/test91.ok
  16.  
  17.  
  18. *** ../vim-7.4.433/src/eval.c    2014-08-29 15:53:43.706453155 +0200
  19. --- src/eval.c    2014-09-09 16:03:34.372530448 +0200
  20. ***************
  21. *** 12071,12077 ****
  22.       typval_T    *argvars;
  23.       typval_T    *rettv;
  24.   {
  25. !     tabpage_T    *tp;
  26.       dictitem_T    *v;
  27.       char_u    *varname;
  28.       int        done = FALSE;
  29. --- 12071,12078 ----
  30.       typval_T    *argvars;
  31.       typval_T    *rettv;
  32.   {
  33. !     win_T    *win, *oldcurwin;
  34. !     tabpage_T    *tp, *oldtabpage;
  35.       dictitem_T    *v;
  36.       char_u    *varname;
  37.       int        done = FALSE;
  38. ***************
  39. *** 12083,12095 ****
  40.       tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
  41.       if (tp != NULL && varname != NULL)
  42.       {
  43.       /* look up the variable */
  44. !     v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 0, varname, FALSE);
  45.       if (v != NULL)
  46.       {
  47.           copy_tv(&v->di_tv, rettv);
  48.           done = TRUE;
  49.       }
  50.       }
  51.   
  52.       if (!done && argvars[2].v_type != VAR_UNKNOWN)
  53. --- 12084,12104 ----
  54.       tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
  55.       if (tp != NULL && varname != NULL)
  56.       {
  57. +     /* Set curwin to be our win, temporarily.  Also set the tabpage,
  58. +      * otherwise the window is not valid. */
  59. +     switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE);
  60.       /* look up the variable */
  61. !     /* Let gettabvar({nr}, "") return the "t:" dictionary. */
  62. !     v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE);
  63.       if (v != NULL)
  64.       {
  65.           copy_tv(&v->di_tv, rettv);
  66.           done = TRUE;
  67.       }
  68. +     /* restore previous notion of curwin */
  69. +     restore_win(oldcurwin, oldtabpage, TRUE);
  70.       }
  71.   
  72.       if (!done && argvars[2].v_type != VAR_UNKNOWN)
  73. *** ../vim-7.4.433/runtime/doc/eval.txt    2014-08-29 15:53:43.714453155 +0200
  74. --- runtime/doc/eval.txt    2014-09-09 16:00:31.776530049 +0200
  75. ***************
  76. *** 3535,3540 ****
  77. --- 3576,3583 ----
  78.           Get the value of a tab-local variable {varname} in tab page
  79.           {tabnr}. |t:var|
  80.           Tabs are numbered starting with one.
  81. +         When {varname} is empty a dictionary with all tab-local
  82. +         variables is returned.
  83.           Note that the name without "t:" must be used.
  84.           When the tab or variable doesn't exist {def} or an empty
  85.           string is returned, there is no error message.
  86. *** ../vim-7.4.433/src/testdir/test91.in    2013-07-24 14:53:47.000000000 +0200
  87. --- src/testdir/test91.in    2014-09-09 16:08:40.116531116 +0200
  88. ***************
  89. *** 55,60 ****
  90. --- 55,61 ----
  91.   :tabnew
  92.   :tabnew
  93.   :let t:var_list = [1, 2, 3]
  94. + :let t:other = 777
  95.   :let def_list = [4, 5, 6, 7]
  96.   :tabrewind
  97.   :$put =string(gettabvar(3, 'var_list'))
  98. *** ../vim-7.4.433/src/testdir/test91.ok    2013-07-24 14:52:47.000000000 +0200
  99. --- src/testdir/test91.ok    2014-09-09 16:09:27.624531220 +0200
  100. ***************
  101. *** 26,33 ****
  102.   0
  103.   [1, 2, 3]
  104.   [1, 2, 3]
  105. ! ''
  106. ! [4, 5, 6, 7]
  107.   [4, 5, 6, 7]
  108.   ''
  109.   [4, 5, 6, 7]
  110. --- 26,33 ----
  111.   0
  112.   [1, 2, 3]
  113.   [1, 2, 3]
  114. ! {'var_list': [1, 2, 3], 'other': 777}
  115. ! {'var_list': [1, 2, 3], 'other': 777}
  116.   [4, 5, 6, 7]
  117.   ''
  118.   [4, 5, 6, 7]
  119. *** ../vim-7.4.433/src/version.c    2014-09-09 13:52:55.028513324 +0200
  120. --- src/version.c    2014-09-09 16:09:17.824531199 +0200
  121. ***************
  122. *** 743,744 ****
  123. --- 743,746 ----
  124.   {   /* Add new patch number below this line */
  125. + /**/
  126. +     434,
  127.   /**/
  128.  
  129. -- 
  130. hundred-and-one symptoms of being an internet addict:
  131. 108. While reading a magazine, you look for the Zoom icon for a better
  132.      look at a photograph.
  133.  
  134.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  135. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  136. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  137.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  138.