Karsten Hopp a25991
To: vim_dev@googlegroups.com
Karsten Hopp a25991
Subject: Patch 7.3.831
Karsten Hopp a25991
Fcc: outbox
Karsten Hopp a25991
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp a25991
Mime-Version: 1.0
Karsten Hopp a25991
Content-Type: text/plain; charset=UTF-8
Karsten Hopp a25991
Content-Transfer-Encoding: 8bit
Karsten Hopp a25991
------------
Karsten Hopp a25991
Karsten Hopp a25991
Patch 7.3.831
Karsten Hopp a25991
Problem:    Clumsy to handle the situation that a variable does not exist.
Karsten Hopp a25991
Solution:   Add default value to getbufvar() et al. (Shougo Matsushita,
Karsten Hopp a25991
	    Hirohito Higashi)
Karsten Hopp a25991
Files:	    runtime/doc/eval.txt, src/eval.c src/testdir/test91.in,
Karsten Hopp a25991
	    src/testdir/test91.ok, src/testdir/Make_amiga.mak,
Karsten Hopp a25991
	    src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
Karsten Hopp a25991
	    src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
Karsten Hopp a25991
	    src/testdir/Makefile
Karsten Hopp a25991
Karsten Hopp a25991
Karsten Hopp a25991
*** ../vim-7.3.830/runtime/doc/eval.txt	2013-02-20 17:58:01.000000000 +0100
Karsten Hopp a25991
--- runtime/doc/eval.txt	2013-02-20 20:53:50.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 1761,1772 ****
Karsten Hopp a25991
  foldtextresult( {lnum})		String	text for closed fold at {lnum}
Karsten Hopp a25991
  foreground( )			Number	bring the Vim window to the foreground
Karsten Hopp a25991
  function( {name})		Funcref reference to function {name}
Karsten Hopp a25991
! garbagecollect( [at_exit])	none	free memory, breaking cyclic references
Karsten Hopp a25991
  get( {list}, {idx} [, {def}])	any	get item {idx} from {list} or {def}
Karsten Hopp a25991
  get( {dict}, {key} [, {def}])	any	get item {key} from {dict} or {def}
Karsten Hopp a25991
  getbufline( {expr}, {lnum} [, {end}])
Karsten Hopp a25991
  				List	lines {lnum} to {end} of buffer {expr}
Karsten Hopp a25991
! getbufvar( {expr}, {varname})	any	variable {varname} in buffer {expr}
Karsten Hopp a25991
  getchar( [expr])		Number	get one character from the user
Karsten Hopp a25991
  getcharmod( )			Number	modifiers for the last typed character
Karsten Hopp a25991
  getcmdline()			String	return the current command-line
Karsten Hopp a25991
--- 1772,1784 ----
Karsten Hopp a25991
  foldtextresult( {lnum})		String	text for closed fold at {lnum}
Karsten Hopp a25991
  foreground( )			Number	bring the Vim window to the foreground
Karsten Hopp a25991
  function( {name})		Funcref reference to function {name}
Karsten Hopp a25991
! garbagecollect( [{atexit}])	none	free memory, breaking cyclic references
Karsten Hopp a25991
  get( {list}, {idx} [, {def}])	any	get item {idx} from {list} or {def}
Karsten Hopp a25991
  get( {dict}, {key} [, {def}])	any	get item {key} from {dict} or {def}
Karsten Hopp a25991
  getbufline( {expr}, {lnum} [, {end}])
Karsten Hopp a25991
  				List	lines {lnum} to {end} of buffer {expr}
Karsten Hopp a25991
! getbufvar( {expr}, {varname} [, {def}])
Karsten Hopp a25991
! 				any	variable {varname} in buffer {expr}
Karsten Hopp a25991
  getchar( [expr])		Number	get one character from the user
Karsten Hopp a25991
  getcharmod( )			Number	modifiers for the last typed character
Karsten Hopp a25991
  getcmdline()			String	return the current command-line
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 1787,1798 ****
Karsten Hopp a25991
  getqflist()			List	list of quickfix items
Karsten Hopp a25991
  getreg( [{regname} [, 1]])	String	contents of register
Karsten Hopp a25991
  getregtype( [{regname}])	String	type of register
Karsten Hopp a25991
! gettabvar( {nr}, {varname})	any	variable {varname} in tab {nr}
Karsten Hopp a25991
! gettabwinvar( {tabnr}, {winnr}, {name})
Karsten Hopp a25991
  				any	{name} in {winnr} in tab page {tabnr}
Karsten Hopp a25991
  getwinposx()			Number	X coord in pixels of GUI Vim window
Karsten Hopp a25991
  getwinposy()			Number	Y coord in pixels of GUI Vim window
Karsten Hopp a25991
! getwinvar( {nr}, {varname})	any	variable {varname} in window {nr}
Karsten Hopp a25991
  glob( {expr} [, {nosuf} [, {list}]])
Karsten Hopp a25991
  				any	expand file wildcards in {expr}
Karsten Hopp a25991
  globpath( {path}, {expr} [, {flag}])
Karsten Hopp a25991
--- 1799,1812 ----
Karsten Hopp a25991
  getqflist()			List	list of quickfix items
Karsten Hopp a25991
  getreg( [{regname} [, 1]])	String	contents of register
Karsten Hopp a25991
  getregtype( [{regname}])	String	type of register
Karsten Hopp a25991
! gettabvar( {nr}, {varname} [, {def}])
Karsten Hopp a25991
! 				any	variable {varname} in tab {nr} or {def}
Karsten Hopp a25991
! gettabwinvar( {tabnr}, {winnr}, {name} [, {def}])
Karsten Hopp a25991
  				any	{name} in {winnr} in tab page {tabnr}
Karsten Hopp a25991
  getwinposx()			Number	X coord in pixels of GUI Vim window
Karsten Hopp a25991
  getwinposy()			Number	Y coord in pixels of GUI Vim window
Karsten Hopp a25991
! getwinvar( {nr}, {varname} [, {def}])
Karsten Hopp a25991
! 				any	variable {varname} in window {nr}
Karsten Hopp a25991
  glob( {expr} [, {nosuf} [, {list}]])
Karsten Hopp a25991
  				any	expand file wildcards in {expr}
Karsten Hopp a25991
  globpath( {path}, {expr} [, {flag}])
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 3131,3137 ****
Karsten Hopp a25991
  		Example: >
Karsten Hopp a25991
  			:let lines = getbufline(bufnr("myfile"), 1, "$")
Karsten Hopp a25991
  
Karsten Hopp a25991
! getbufvar({expr}, {varname})				*getbufvar()*
Karsten Hopp a25991
  		The result is the value of option or local buffer variable
Karsten Hopp a25991
  		{varname} in buffer {expr}.  Note that the name without "b:"
Karsten Hopp a25991
  		must be used.
Karsten Hopp a25991
--- 3146,3152 ----
Karsten Hopp a25991
  		Example: >
Karsten Hopp a25991
  			:let lines = getbufline(bufnr("myfile"), 1, "$")
Karsten Hopp a25991
  
Karsten Hopp a25991
! getbufvar({expr}, {varname} [, {def}])				*getbufvar()*
Karsten Hopp a25991
  		The result is the value of option or local buffer variable
Karsten Hopp a25991
  		{varname} in buffer {expr}.  Note that the name without "b:"
Karsten Hopp a25991
  		must be used.
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 3141,3148 ****
Karsten Hopp a25991
  		doesn't work for a global variable, window-local variable or
Karsten Hopp a25991
  		window-local option.
Karsten Hopp a25991
  		For the use of {expr}, see |bufname()| above.
Karsten Hopp a25991
! 		When the buffer or variable doesn't exist an empty string is
Karsten Hopp a25991
! 		returned, there is no error message.
Karsten Hopp a25991
  		Examples: >
Karsten Hopp a25991
  			:let bufmodified = getbufvar(1, "&mod")
Karsten Hopp a25991
  			:echo "todo myvar = " . getbufvar("todo", "myvar")
Karsten Hopp a25991
--- 3156,3163 ----
Karsten Hopp a25991
  		doesn't work for a global variable, window-local variable or
Karsten Hopp a25991
  		window-local option.
Karsten Hopp a25991
  		For the use of {expr}, see |bufname()| above.
Karsten Hopp a25991
! 		When the buffer or variable doesn't exist {def} or an empty
Karsten Hopp a25991
! 		string is returned, there is no error message.
Karsten Hopp a25991
  		Examples: >
Karsten Hopp a25991
  			:let bufmodified = getbufvar(1, "&mod")
Karsten Hopp a25991
  			:echo "todo myvar = " . getbufvar("todo", "myvar")
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 3414,3439 ****
Karsten Hopp a25991
  		<CTRL-V> is one character with value 0x16.
Karsten Hopp a25991
  		If {regname} is not specified, |v:register| is used.
Karsten Hopp a25991
  
Karsten Hopp a25991
! gettabvar({tabnr}, {varname})				*gettabvar()*
Karsten Hopp a25991
  		Get the value of a tab-local variable {varname} in tab page
Karsten Hopp a25991
  		{tabnr}. |t:var|
Karsten Hopp a25991
  		Tabs are numbered starting with one.
Karsten Hopp a25991
  		Note that the name without "t:" must be used.
Karsten Hopp a25991
  
Karsten Hopp a25991
! gettabwinvar({tabnr}, {winnr}, {varname})		*gettabwinvar()*
Karsten Hopp a25991
  		Get the value of window-local variable {varname} in window
Karsten Hopp a25991
  		{winnr} in tab page {tabnr}.
Karsten Hopp a25991
  		When {varname} starts with "&" get the value of a window-local
Karsten Hopp a25991
  		option.
Karsten Hopp a25991
  		Tabs are numbered starting with one.  For the current tabpage
Karsten Hopp a25991
  		use |getwinvar()|.
Karsten Hopp a25991
  		When {winnr} is zero the current window is used.
Karsten Hopp a25991
  		This also works for a global option, buffer-local option and
Karsten Hopp a25991
  		window-local option, but it doesn't work for a global variable
Karsten Hopp a25991
  		or buffer-local variable.
Karsten Hopp a25991
! 		When {varname} is empty a dictionary with all window-local
Karsten Hopp a25991
! 		variables is returned.
Karsten Hopp a25991
! 		Note that {varname} must be the name without "w:".
Karsten Hopp a25991
  		Examples: >
Karsten Hopp a25991
  			:let list_is_on = gettabwinvar(1, 2, '&list')
Karsten Hopp a25991
  			:echo "myvar = " . gettabwinvar(3, 1, 'myvar')
Karsten Hopp a25991
--- 3434,3463 ----
Karsten Hopp a25991
  		<CTRL-V> is one character with value 0x16.
Karsten Hopp a25991
  		If {regname} is not specified, |v:register| is used.
Karsten Hopp a25991
  
Karsten Hopp a25991
! gettabvar({tabnr}, {varname} [, {def}])				*gettabvar()*
Karsten Hopp a25991
  		Get the value of a tab-local variable {varname} in tab page
Karsten Hopp a25991
  		{tabnr}. |t:var|
Karsten Hopp a25991
  		Tabs are numbered starting with one.
Karsten Hopp a25991
  		Note that the name without "t:" must be used.
Karsten Hopp a25991
+ 		When the tab or variable doesn't exist {def} or an empty
Karsten Hopp a25991
+ 		string is returned, there is no error message.
Karsten Hopp a25991
  
Karsten Hopp a25991
! gettabwinvar({tabnr}, {winnr}, {varname} [, {def}])		*gettabwinvar()*
Karsten Hopp a25991
  		Get the value of window-local variable {varname} in window
Karsten Hopp a25991
  		{winnr} in tab page {tabnr}.
Karsten Hopp a25991
  		When {varname} starts with "&" get the value of a window-local
Karsten Hopp a25991
  		option.
Karsten Hopp a25991
+ 		When {varname} is empty a dictionary with all window-local
Karsten Hopp a25991
+ 		variables is returned.
Karsten Hopp a25991
+ 		Note that {varname} must be the name without "w:".
Karsten Hopp a25991
  		Tabs are numbered starting with one.  For the current tabpage
Karsten Hopp a25991
  		use |getwinvar()|.
Karsten Hopp a25991
  		When {winnr} is zero the current window is used.
Karsten Hopp a25991
  		This also works for a global option, buffer-local option and
Karsten Hopp a25991
  		window-local option, but it doesn't work for a global variable
Karsten Hopp a25991
  		or buffer-local variable.
Karsten Hopp a25991
! 		When the tab, window or variable doesn't exist {def} or an
Karsten Hopp a25991
! 		empty string is returned, there is no error message.
Karsten Hopp a25991
  		Examples: >
Karsten Hopp a25991
  			:let list_is_on = gettabwinvar(1, 2, '&list')
Karsten Hopp a25991
  			:echo "myvar = " . gettabwinvar(3, 1, 'myvar')
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 3448,3454 ****
Karsten Hopp a25991
  		the top of the GUI Vim window.	The result will be -1 if the
Karsten Hopp a25991
  		information is not available.
Karsten Hopp a25991
  
Karsten Hopp a25991
! getwinvar({winnr}, {varname})				*getwinvar()*
Karsten Hopp a25991
  		Like |gettabwinvar()| for the current tabpage.
Karsten Hopp a25991
  		Examples: >
Karsten Hopp a25991
  			:let list_is_on = getwinvar(2, '&list')
Karsten Hopp a25991
--- 3472,3478 ----
Karsten Hopp a25991
  		the top of the GUI Vim window.	The result will be -1 if the
Karsten Hopp a25991
  		information is not available.
Karsten Hopp a25991
  
Karsten Hopp a25991
! getwinvar({winnr}, {varname} [, {def}])				*getwinvar()*
Karsten Hopp a25991
  		Like |gettabwinvar()| for the current tabpage.
Karsten Hopp a25991
  		Examples: >
Karsten Hopp a25991
  			:let list_is_on = getwinvar(2, '&list')
Karsten Hopp a25991
*** ../vim-7.3.830/src/eval.c	2013-02-20 17:58:01.000000000 +0100
Karsten Hopp a25991
--- src/eval.c	2013-02-20 20:52:09.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 7916,7922 ****
Karsten Hopp a25991
      {"garbagecollect",	0, 1, f_garbagecollect},
Karsten Hopp a25991
      {"get",		2, 3, f_get},
Karsten Hopp a25991
      {"getbufline",	2, 3, f_getbufline},
Karsten Hopp a25991
!     {"getbufvar",	2, 2, f_getbufvar},
Karsten Hopp a25991
      {"getchar",		0, 1, f_getchar},
Karsten Hopp a25991
      {"getcharmod",	0, 0, f_getcharmod},
Karsten Hopp a25991
      {"getcmdline",	0, 0, f_getcmdline},
Karsten Hopp a25991
--- 7916,7922 ----
Karsten Hopp a25991
      {"garbagecollect",	0, 1, f_garbagecollect},
Karsten Hopp a25991
      {"get",		2, 3, f_get},
Karsten Hopp a25991
      {"getbufline",	2, 3, f_getbufline},
Karsten Hopp a25991
!     {"getbufvar",	2, 3, f_getbufvar},
Karsten Hopp a25991
      {"getchar",		0, 1, f_getchar},
Karsten Hopp a25991
      {"getcharmod",	0, 0, f_getcharmod},
Karsten Hopp a25991
      {"getcmdline",	0, 0, f_getcmdline},
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 7936,7946 ****
Karsten Hopp a25991
      {"getqflist",	0, 0, f_getqflist},
Karsten Hopp a25991
      {"getreg",		0, 2, f_getreg},
Karsten Hopp a25991
      {"getregtype",	0, 1, f_getregtype},
Karsten Hopp a25991
!     {"gettabvar",	2, 2, f_gettabvar},
Karsten Hopp a25991
!     {"gettabwinvar",	3, 3, f_gettabwinvar},
Karsten Hopp a25991
      {"getwinposx",	0, 0, f_getwinposx},
Karsten Hopp a25991
      {"getwinposy",	0, 0, f_getwinposy},
Karsten Hopp a25991
!     {"getwinvar",	2, 2, f_getwinvar},
Karsten Hopp a25991
      {"glob",		1, 3, f_glob},
Karsten Hopp a25991
      {"globpath",	2, 3, f_globpath},
Karsten Hopp a25991
      {"has",		1, 1, f_has},
Karsten Hopp a25991
--- 7936,7946 ----
Karsten Hopp a25991
      {"getqflist",	0, 0, f_getqflist},
Karsten Hopp a25991
      {"getreg",		0, 2, f_getreg},
Karsten Hopp a25991
      {"getregtype",	0, 1, f_getregtype},
Karsten Hopp a25991
!     {"gettabvar",	2, 3, f_gettabvar},
Karsten Hopp a25991
!     {"gettabwinvar",	3, 4, f_gettabwinvar},
Karsten Hopp a25991
      {"getwinposx",	0, 0, f_getwinposx},
Karsten Hopp a25991
      {"getwinposy",	0, 0, f_getwinposy},
Karsten Hopp a25991
!     {"getwinvar",	2, 3, f_getwinvar},
Karsten Hopp a25991
      {"glob",		1, 3, f_glob},
Karsten Hopp a25991
      {"globpath",	2, 3, f_globpath},
Karsten Hopp a25991
      {"has",		1, 1, f_has},
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 11115,11122 ****
Karsten Hopp a25991
      ++emsg_off;
Karsten Hopp a25991
      buf = get_buf_tv(&argvars[0]);
Karsten Hopp a25991
  
Karsten Hopp a25991
!     rettv->v_type = VAR_STRING;
Karsten Hopp a25991
!     rettv->vval.v_string = NULL;
Karsten Hopp a25991
  
Karsten Hopp a25991
      if (buf != NULL && varname != NULL)
Karsten Hopp a25991
      {
Karsten Hopp a25991
--- 11115,11128 ----
Karsten Hopp a25991
      ++emsg_off;
Karsten Hopp a25991
      buf = get_buf_tv(&argvars[0]);
Karsten Hopp a25991
  
Karsten Hopp a25991
!     if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp a25991
! 	/* set the default value */
Karsten Hopp a25991
! 	copy_tv(&argvars[2], rettv);
Karsten Hopp a25991
!     else
Karsten Hopp a25991
!     {
Karsten Hopp a25991
! 	rettv->v_type = VAR_STRING;
Karsten Hopp a25991
! 	rettv->vval.v_string = NULL;
Karsten Hopp a25991
!     }
Karsten Hopp a25991
  
Karsten Hopp a25991
      if (buf != NULL && varname != NULL)
Karsten Hopp a25991
      {
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 11785,11791 ****
Karsten Hopp a25991
--- 11791,11801 ----
Karsten Hopp a25991
  	v = find_var_in_ht(&tp->tp_vars.dv_hashtab, varname, FALSE);
Karsten Hopp a25991
  	if (v != NULL)
Karsten Hopp a25991
  	    copy_tv(&v->di_tv, rettv);
Karsten Hopp a25991
+ 	else if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp a25991
+ 	    copy_tv(&argvars[2], rettv);
Karsten Hopp a25991
      }
Karsten Hopp a25991
+     else if (argvars[2].v_type != VAR_UNKNOWN)
Karsten Hopp a25991
+ 	copy_tv(&argvars[2], rettv);
Karsten Hopp a25991
  }
Karsten Hopp a25991
  
Karsten Hopp a25991
  /*
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 11907,11914 ****
Karsten Hopp a25991
      varname = get_tv_string_chk(&argvars[off + 1]);
Karsten Hopp a25991
      ++emsg_off;
Karsten Hopp a25991
  
Karsten Hopp a25991
!     rettv->v_type = VAR_STRING;
Karsten Hopp a25991
!     rettv->vval.v_string = NULL;
Karsten Hopp a25991
  
Karsten Hopp a25991
      if (win != NULL && varname != NULL)
Karsten Hopp a25991
      {
Karsten Hopp a25991
--- 11917,11930 ----
Karsten Hopp a25991
      varname = get_tv_string_chk(&argvars[off + 1]);
Karsten Hopp a25991
      ++emsg_off;
Karsten Hopp a25991
  
Karsten Hopp a25991
!     if (argvars[off + 2].v_type != VAR_UNKNOWN)
Karsten Hopp a25991
! 	/* set the default return value */
Karsten Hopp a25991
! 	copy_tv(&argvars[off + 2], rettv);
Karsten Hopp a25991
!     else
Karsten Hopp a25991
!     {
Karsten Hopp a25991
! 	rettv->v_type = VAR_STRING;
Karsten Hopp a25991
! 	rettv->vval.v_string = NULL;
Karsten Hopp a25991
!     }
Karsten Hopp a25991
  
Karsten Hopp a25991
      if (win != NULL && varname != NULL)
Karsten Hopp a25991
      {
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/test91.in	2013-02-20 21:09:20.000000000 +0100
Karsten Hopp a25991
--- src/testdir/test91.in	2013-02-20 20:57:49.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 0 ****
Karsten Hopp a25991
--- 1,98 ----
Karsten Hopp a25991
+ Tests for getbufvar(), getwinvar(), gettabvar() and gettabwinvar().
Karsten Hopp a25991
+ vim: set ft=vim :
Karsten Hopp a25991
+ 
Karsten Hopp a25991
+ STARTTEST
Karsten Hopp a25991
+ :so small.vim
Karsten Hopp a25991
+ :"
Karsten Hopp a25991
+ :" test for getbufvar()
Karsten Hopp a25991
+ :let b:var_num = 1234
Karsten Hopp a25991
+ :let def_num = 5678
Karsten Hopp a25991
+ :$put =string(getbufvar(1, 'var_num'))
Karsten Hopp a25991
+ :$put =string(getbufvar(1, 'var_num', def_num))
Karsten Hopp a25991
+ :$put =string(getbufvar(1, ''))
Karsten Hopp a25991
+ :$put =string(getbufvar(1, '', def_num))
Karsten Hopp a25991
+ :unlet b:var_num
Karsten Hopp a25991
+ :$put =string(getbufvar(1, 'var_num', def_num))
Karsten Hopp a25991
+ :$put =string(getbufvar(1, ''))
Karsten Hopp a25991
+ :$put =string(getbufvar(1, '', def_num))
Karsten Hopp a25991
+ :$put =string(getbufvar(9, ''))
Karsten Hopp a25991
+ :$put =string(getbufvar(9, '', def_num))
Karsten Hopp a25991
+ :unlet def_num
Karsten Hopp a25991
+ :$put =string(getbufvar(1, '&autoindent'))
Karsten Hopp a25991
+ :$put =string(getbufvar(1, '&autoindent', 1))
Karsten Hopp a25991
+ :"
Karsten Hopp a25991
+ :" test for getwinvar()
Karsten Hopp a25991
+ :let w:var_str = "Dance"
Karsten Hopp a25991
+ :let def_str = "Chance"
Karsten Hopp a25991
+ :$put =string(getwinvar(1, 'var_str'))
Karsten Hopp a25991
+ :$put =string(getwinvar(1, 'var_str', def_str))
Karsten Hopp a25991
+ :$put =string(getwinvar(1, ''))
Karsten Hopp a25991
+ :$put =string(getwinvar(1, '', def_str))
Karsten Hopp a25991
+ :unlet w:var_str
Karsten Hopp a25991
+ :$put =string(getwinvar(1, 'var_str', def_str))
Karsten Hopp a25991
+ :$put =string(getwinvar(1, ''))
Karsten Hopp a25991
+ :$put =string(getwinvar(1, '', def_str))
Karsten Hopp a25991
+ :$put =string(getwinvar(9, ''))
Karsten Hopp a25991
+ :$put =string(getwinvar(9, '', def_str))
Karsten Hopp a25991
+ :$put =string(getwinvar(1, '&nu'))
Karsten Hopp a25991
+ :$put =string(getwinvar(1, '&nu',  1))
Karsten Hopp a25991
+ :unlet def_str
Karsten Hopp a25991
+ :"
Karsten Hopp a25991
+ :" test for gettabvar()
Karsten Hopp a25991
+ :tabnew
Karsten Hopp a25991
+ :tabnew
Karsten Hopp a25991
+ :let t:var_list = [1, 2, 3]
Karsten Hopp a25991
+ :let def_list = [4, 5, 6, 7]
Karsten Hopp a25991
+ :tabrewind
Karsten Hopp a25991
+ :$put =string(gettabvar(3, 'var_list'))
Karsten Hopp a25991
+ :$put =string(gettabvar(3, 'var_list', def_list))
Karsten Hopp a25991
+ :$put =string(gettabvar(3, ''))
Karsten Hopp a25991
+ :$put =string(gettabvar(3, '', def_list))
Karsten Hopp a25991
+ :tablast
Karsten Hopp a25991
+ :unlet t:var_list
Karsten Hopp a25991
+ :tabrewind
Karsten Hopp a25991
+ :$put =string(gettabvar(3, 'var_list', def_list))
Karsten Hopp a25991
+ :$put =string(gettabvar(9, ''))
Karsten Hopp a25991
+ :$put =string(gettabvar(9, '', def_list))
Karsten Hopp a25991
+ :$put =string(gettabvar(3, '&nu'))
Karsten Hopp a25991
+ :$put =string(gettabvar(3, '&nu', def_list))
Karsten Hopp a25991
+ :unlet def_list
Karsten Hopp a25991
+ :tabonly
Karsten Hopp a25991
+ :"
Karsten Hopp a25991
+ :" test for gettabwinvar()
Karsten Hopp a25991
+ :tabnew
Karsten Hopp a25991
+ :tabnew
Karsten Hopp a25991
+ :tabprev
Karsten Hopp a25991
+ :split
Karsten Hopp a25991
+ :split
Karsten Hopp a25991
+ :wincmd w
Karsten Hopp a25991
+ :vert split
Karsten Hopp a25991
+ :wincmd w
Karsten Hopp a25991
+ :let w:var_dict = {'dict': 'tabwin'}
Karsten Hopp a25991
+ :let def_dict = {'dict2': 'newval'}
Karsten Hopp a25991
+ :wincmd b
Karsten Hopp a25991
+ :tabrewind
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, 'var_dict'))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, ''))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, '', def_dict))
Karsten Hopp a25991
+ :tabnext
Karsten Hopp a25991
+ :3wincmd w
Karsten Hopp a25991
+ :unlet w:var_dict
Karsten Hopp a25991
+ :tabrewind
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, ''))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, '', def_dict))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 9, ''))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 9, '', def_dict))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(9, 3, ''))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(9, 3, '', def_dict))
Karsten Hopp a25991
+ :unlet def_dict
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, '&nux'))
Karsten Hopp a25991
+ :$put =string(gettabwinvar(2, 3, '&nux', 1))
Karsten Hopp a25991
+ :tabonly
Karsten Hopp a25991
+ :"
Karsten Hopp a25991
+ :/^start/,$wq! test.out
Karsten Hopp a25991
+ ENDTEST
Karsten Hopp a25991
+ 
Karsten Hopp a25991
+ start:
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/test91.ok	2013-02-20 21:09:20.000000000 +0100
Karsten Hopp a25991
--- src/testdir/test91.ok	2013-02-20 20:57:45.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 0 ****
Karsten Hopp a25991
--- 1,45 ----
Karsten Hopp a25991
+ start:
Karsten Hopp a25991
+ 1234
Karsten Hopp a25991
+ 1234
Karsten Hopp a25991
+ {'var_num': 1234}
Karsten Hopp a25991
+ {'var_num': 1234}
Karsten Hopp a25991
+ 5678
Karsten Hopp a25991
+ {}
Karsten Hopp a25991
+ {}
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ 5678
Karsten Hopp a25991
+ 0
Karsten Hopp a25991
+ 0
Karsten Hopp a25991
+ 'Dance'
Karsten Hopp a25991
+ 'Dance'
Karsten Hopp a25991
+ {'var_str': 'Dance'}
Karsten Hopp a25991
+ {'var_str': 'Dance'}
Karsten Hopp a25991
+ 'Chance'
Karsten Hopp a25991
+ {}
Karsten Hopp a25991
+ {}
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ 'Chance'
Karsten Hopp a25991
+ 0
Karsten Hopp a25991
+ 0
Karsten Hopp a25991
+ [1, 2, 3]
Karsten Hopp a25991
+ [1, 2, 3]
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ [4, 5, 6, 7]
Karsten Hopp a25991
+ [4, 5, 6, 7]
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ [4, 5, 6, 7]
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ [4, 5, 6, 7]
Karsten Hopp a25991
+ {'dict': 'tabwin'}
Karsten Hopp a25991
+ {'dict': 'tabwin'}
Karsten Hopp a25991
+ {'var_dict': {'dict': 'tabwin'}}
Karsten Hopp a25991
+ {'var_dict': {'dict': 'tabwin'}}
Karsten Hopp a25991
+ {'dict2': 'newval'}
Karsten Hopp a25991
+ {}
Karsten Hopp a25991
+ {}
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ {'dict2': 'newval'}
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ {'dict2': 'newval'}
Karsten Hopp a25991
+ ''
Karsten Hopp a25991
+ 1
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/Make_amiga.mak	2013-02-13 17:34:59.000000000 +0100
Karsten Hopp a25991
--- src/testdir/Make_amiga.mak	2013-02-20 20:21:03.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 32,38 ****
Karsten Hopp a25991
  		test71.out test72.out test73.out test74.out test75.out \
Karsten Hopp a25991
  		test76.out test77.out test78.out test79.out test80.out \
Karsten Hopp a25991
  		test81.out test82.out test83.out test84.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  .SUFFIXES: .in .out
Karsten Hopp a25991
  
Karsten Hopp a25991
--- 32,38 ----
Karsten Hopp a25991
  		test71.out test72.out test73.out test74.out test75.out \
Karsten Hopp a25991
  		test76.out test77.out test78.out test79.out test80.out \
Karsten Hopp a25991
  		test81.out test82.out test83.out test84.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out test91.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  .SUFFIXES: .in .out
Karsten Hopp a25991
  
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 139,141 ****
Karsten Hopp a25991
--- 139,142 ----
Karsten Hopp a25991
  test88.out: test88.in
Karsten Hopp a25991
  test89.out: test89.in
Karsten Hopp a25991
  test90.out: test90.in
Karsten Hopp a25991
+ test91.out: test91.in
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/Make_dos.mak	2013-02-13 17:34:59.000000000 +0100
Karsten Hopp a25991
--- src/testdir/Make_dos.mak	2013-02-20 20:21:13.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 31,37 ****
Karsten Hopp a25991
  		test74.out test75.out test76.out test77.out test78.out \
Karsten Hopp a25991
  		test79.out test80.out test81.out test82.out test83.out \
Karsten Hopp a25991
  		test84.out test85.out test86.out test87.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp a25991
  
Karsten Hopp a25991
--- 31,37 ----
Karsten Hopp a25991
  		test74.out test75.out test76.out test77.out test78.out \
Karsten Hopp a25991
  		test79.out test80.out test81.out test82.out test83.out \
Karsten Hopp a25991
  		test84.out test85.out test86.out test87.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out test91.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp a25991
  
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/Make_ming.mak	2013-02-13 17:34:59.000000000 +0100
Karsten Hopp a25991
--- src/testdir/Make_ming.mak	2013-02-20 20:21:19.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 51,57 ****
Karsten Hopp a25991
  		test74.out test75.out test76.out test77.out test78.out \
Karsten Hopp a25991
  		test79.out test80.out test81.out test82.out test83.out \
Karsten Hopp a25991
  		test84.out test85.out test86.out test87.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp a25991
  
Karsten Hopp a25991
--- 51,57 ----
Karsten Hopp a25991
  		test74.out test75.out test76.out test77.out test78.out \
Karsten Hopp a25991
  		test79.out test80.out test81.out test82.out test83.out \
Karsten Hopp a25991
  		test84.out test85.out test86.out test87.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out test91.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp a25991
  
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/Make_os2.mak	2013-02-13 17:34:59.000000000 +0100
Karsten Hopp a25991
--- src/testdir/Make_os2.mak	2013-02-20 20:21:25.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 32,38 ****
Karsten Hopp a25991
  		test71.out test72.out test73.out test74.out test75.out \
Karsten Hopp a25991
  		test76.out test77.out test78.out test79.out test80.out \
Karsten Hopp a25991
  		test81.out test82.out test83.out test84.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  .SUFFIXES: .in .out
Karsten Hopp a25991
  
Karsten Hopp a25991
--- 32,38 ----
Karsten Hopp a25991
  		test71.out test72.out test73.out test74.out test75.out \
Karsten Hopp a25991
  		test76.out test77.out test78.out test79.out test80.out \
Karsten Hopp a25991
  		test81.out test82.out test83.out test84.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out test91.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  .SUFFIXES: .in .out
Karsten Hopp a25991
  
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/Make_vms.mms	2013-02-13 17:34:59.000000000 +0100
Karsten Hopp a25991
--- src/testdir/Make_vms.mms	2013-02-20 20:21:31.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 4,10 ****
Karsten Hopp a25991
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp a25991
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp a25991
  #
Karsten Hopp a25991
! # Last change:  2013 Feb 13
Karsten Hopp a25991
  #
Karsten Hopp a25991
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp a25991
  # Edit the lines in the Configuration section below to select.
Karsten Hopp a25991
--- 4,10 ----
Karsten Hopp a25991
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp a25991
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp a25991
  #
Karsten Hopp a25991
! # Last change:  2013 Feb 20
Karsten Hopp a25991
  #
Karsten Hopp a25991
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp a25991
  # Edit the lines in the Configuration section below to select.
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 77,83 ****
Karsten Hopp a25991
  	 test71.out test72.out test74.out test75.out test76.out \
Karsten Hopp a25991
  	 test77.out test78.out test79.out test80.out test81.out \
Karsten Hopp a25991
  	 test82.out test83.out test84.out test88.out test89.out \
Karsten Hopp a25991
! 	 test90.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  # Known problems:
Karsten Hopp a25991
  # Test 30: a problem around mac format - unknown reason
Karsten Hopp a25991
--- 77,83 ----
Karsten Hopp a25991
  	 test71.out test72.out test74.out test75.out test76.out \
Karsten Hopp a25991
  	 test77.out test78.out test79.out test80.out test81.out \
Karsten Hopp a25991
  	 test82.out test83.out test84.out test88.out test89.out \
Karsten Hopp a25991
! 	 test90.out test91.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  # Known problems:
Karsten Hopp a25991
  # Test 30: a problem around mac format - unknown reason
Karsten Hopp a25991
*** ../vim-7.3.830/src/testdir/Makefile	2013-02-13 17:34:59.000000000 +0100
Karsten Hopp a25991
--- src/testdir/Makefile	2013-02-20 20:21:47.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 28,34 ****
Karsten Hopp a25991
  		test74.out test75.out test76.out test77.out test78.out \
Karsten Hopp a25991
  		test79.out test80.out test81.out test82.out test83.out \
Karsten Hopp a25991
  		test84.out test85.out test86.out test87.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  SCRIPTS_GUI = test16.out
Karsten Hopp a25991
  
Karsten Hopp a25991
--- 28,34 ----
Karsten Hopp a25991
  		test74.out test75.out test76.out test77.out test78.out \
Karsten Hopp a25991
  		test79.out test80.out test81.out test82.out test83.out \
Karsten Hopp a25991
  		test84.out test85.out test86.out test87.out test88.out \
Karsten Hopp a25991
! 		test89.out test90.out test91.out
Karsten Hopp a25991
  
Karsten Hopp a25991
  SCRIPTS_GUI = test16.out
Karsten Hopp a25991
  
Karsten Hopp a25991
*** ../vim-7.3.830/src/version.c	2013-02-20 19:26:24.000000000 +0100
Karsten Hopp a25991
--- src/version.c	2013-02-20 21:08:40.000000000 +0100
Karsten Hopp a25991
***************
Karsten Hopp a25991
*** 730,731 ****
Karsten Hopp a25991
--- 730,733 ----
Karsten Hopp a25991
  {   /* Add new patch number below this line */
Karsten Hopp a25991
+ /**/
Karsten Hopp a25991
+     831,
Karsten Hopp a25991
  /**/
Karsten Hopp a25991
Karsten Hopp a25991
-- 
Karsten Hopp a25991
            |
Karsten Hopp a25991
Karsten Hopp a25991
Ceci n'est pas une pipe.
Karsten Hopp a25991
Karsten Hopp a25991
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp a25991
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp a25991
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp a25991
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///