Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.0.124
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.0.124
Problem:    getwinvar() obtains a dictionary with window-local variables, but
	    it's always for the current window.
Solution:   Get the variables of the specified window. (Geoff Reedy)
Files:	    src/eval.c


*** ../vim-7.0.123/src/eval.c	Tue Oct  3 14:43:31 2006
--- src/eval.c	Fri Oct  6 21:08:57 2006
***************
*** 10432,10451 ****
  
      if (win != NULL && varname != NULL)
      {
! 	if (*varname == '&')	/* window-local-option */
! 	{
! 	    /* Set curwin to be our win, temporarily.  Also set curbuf, so
! 	     * that we can get buffer-local options. */
! 	    oldcurwin = curwin;
! 	    curwin = win;
! 	    curbuf = win->w_buffer;
  
  	    get_option_tv(&varname, rettv, 1);
- 
- 	    /* restore previous notion of curwin */
- 	    curwin = oldcurwin;
- 	    curbuf = curwin->w_buffer;
- 	}
  	else
  	{
  	    if (*varname == NUL)
--- 10432,10445 ----
  
      if (win != NULL && varname != NULL)
      {
! 	/* Set curwin to be our win, temporarily.  Also set curbuf, so
! 	 * that we can get buffer-local options. */
! 	oldcurwin = curwin;
! 	curwin = win;
! 	curbuf = win->w_buffer;
  
+ 	if (*varname == '&')	/* window-local-option */
  	    get_option_tv(&varname, rettv, 1);
  	else
  	{
  	    if (*varname == NUL)
***************
*** 10458,10463 ****
--- 10452,10461 ----
  	    if (v != NULL)
  		copy_tv(&v->di_tv, rettv);
  	}
+ 
+ 	/* restore previous notion of curwin */
+ 	curwin = oldcurwin;
+ 	curbuf = curwin->w_buffer;
      }
  
      --emsg_off;
*** ../vim-7.0.123/src/version.c	Tue Oct 10 11:41:44 2006
--- src/version.c	Tue Oct 10 12:53:15 2006
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     124,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
14. Put mosquito netting around your work area. Play a tape of jungle
    sounds all day.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///