summaryrefslogtreecommitdiff
path: root/src/if_py_both.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-12-17 14:46:09 +0100
committerBram Moolenaar <Bram@vim.org>2014-12-17 14:46:09 +0100
commitae38d05271f9f25b6ad39b10e5f41d9656a7f1ab (patch)
treeff87fe9afb45b457ca3566337234ec12b26bd1f7 /src/if_py_both.h
parent36ff08479f0398e09298f5742dcdfa0f8e070a32 (diff)
downloadvim-git-ae38d05271f9f25b6ad39b10e5f41d9656a7f1ab.tar.gz
updated for version 7.4.556v7.4.556
Problem: Failed commands in Python interface not handled correctly. Solution: Restore window and buffer on failure.
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r--src/if_py_both.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 5044afbef..206d2987a 100644
--- 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