3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.556
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.556
3ef2ca
Problem:    Failed commands in Python interface not handled correctly.
3ef2ca
Solution:   Restore window and buffer on failure.
3ef2ca
Files:	    src/if_py_both.h
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.555/src/if_py_both.h	2014-08-29 13:49:48.678436915 +0200
3ef2ca
--- src/if_py_both.h	2014-09-19 14:21:33.474404353 +0200
3ef2ca
***************
3ef2ca
*** 3172,3177 ****
3ef2ca
--- 3172,3178 ----
3ef2ca
  	    if (switch_win(&save_curwin, &save_curtab, (win_T *)from,
3ef2ca
  			      win_find_tabpage((win_T *)from), FALSE) == FAIL)
3ef2ca
  	    {
3ef2ca
+ 		restore_win(save_curwin, save_curtab, TRUE);
3ef2ca
  		if (VimTryEnd())
3ef2ca
  		    return -1;
3ef2ca
  		PyErr_SET_VIM(N_("problem while switching windows"));
3ef2ca
***************
3ef2ca
*** 4032,4040 ****
3ef2ca
      win_T	*wp;
3ef2ca
      tabpage_T	*tp;
3ef2ca
  
3ef2ca
!     if (find_win_for_buf(buf, &wp, &tp) == FAIL
3ef2ca
! 	    || switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
3ef2ca
  	switch_buffer(save_curbufp, buf);
3ef2ca
  }
3ef2ca
  
3ef2ca
      static void
3ef2ca
--- 4033,4045 ----
3ef2ca
      win_T	*wp;
3ef2ca
      tabpage_T	*tp;
3ef2ca
  
3ef2ca
!     if (find_win_for_buf(buf, &wp, &tp) == FAIL)
3ef2ca
  	switch_buffer(save_curbufp, buf);
3ef2ca
+     else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
3ef2ca
+     {
3ef2ca
+ 	restore_win(*save_curwinp, *save_curtabp, TRUE);
3ef2ca
+ 	switch_buffer(save_curbufp, buf);
3ef2ca
+     }
3ef2ca
  }
3ef2ca
  
3ef2ca
      static void
3ef2ca
*** ../vim-7.4.555/src/version.c	2014-12-17 14:42:42.990240206 +0100
3ef2ca
--- src/version.c	2014-12-17 14:44:33.304877367 +0100
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     556,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
4. Your eyeglasses have a web site burned in on them.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///