changeset 6454:a35752526cd0 v7.4.556

updated for version 7.4.556 Problem: Failed commands in Python interface not handled correctly. Solution: Restore window and buffer on failure.
author Bram Moolenaar <bram@vim.org>
date Wed, 17 Dec 2014 14:46:09 +0100
parents 5ed01d6d262b
children f85826493bb0
files src/if_py_both.h src/version.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -3172,6 +3172,7 @@ set_option_value_for(
 	    if (switch_win(&save_curwin, &save_curtab, (win_T *)from,
 			      win_find_tabpage((win_T *)from), FALSE) == FAIL)
 	    {
+		restore_win(save_curwin, save_curtab, TRUE);
 		if (VimTryEnd())
 		    return -1;
 		PyErr_SET_VIM(N_("problem while switching windows"));
@@ -4032,9 +4033,13 @@ switch_to_win_for_buf(
     win_T	*wp;
     tabpage_T	*tp;
 
-    if (find_win_for_buf(buf, &wp, &tp) == FAIL
-	    || switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
+    if (find_win_for_buf(buf, &wp, &tp) == FAIL)
 	switch_buffer(save_curbufp, buf);
+    else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
+    {
+	restore_win(*save_curwinp, *save_curtabp, TRUE);
+	switch_buffer(save_curbufp, buf);
+    }
 }
 
     static void
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    556,
+/**/
     555,
 /**/
     554,