summaryrefslogtreecommitdiff
path: root/src/popupmnu.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-26 22:04:04 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-26 22:04:04 +0200
commit9ad89c6c4f89cd710d8244d8010b8b0ae30ba79d (patch)
tree47d4e016c05fa553fd36b0547029372a23475006 /src/popupmnu.c
parentce11de87e26e1420703242f8e07b4fd69c4032ba (diff)
downloadvim-git-9ad89c6c4f89cd710d8244d8010b8b0ae30ba79d.tar.gz
patch 8.0.1223: crash when using autocomplete and tab pagesv8.0.1223
Problem: Crash when using autocomplete and tab pages. Solution: Check if the current tab changed. (Christian Brabandt, closes #2239)
Diffstat (limited to 'src/popupmnu.c')
-rw-r--r--src/popupmnu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c
index 418f0ca61..ec75281e7 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -566,6 +566,7 @@ pum_set_selected(int n, int repeat)
&& vim_strchr(p_cot, 'p') != NULL)
{
win_T *curwin_save = curwin;
+ tabpage_T *curtab_save = curtab;
int res = OK;
/* Open a preview window. 3 lines by default. Prefer
@@ -653,8 +654,13 @@ pum_set_selected(int n, int repeat)
curwin->w_cursor.lnum = 1;
curwin->w_cursor.col = 0;
- if (curwin != curwin_save && win_valid(curwin_save))
+ if ((curwin != curwin_save && win_valid(curwin_save))
+ || (curtab != curtab_save
+ && valid_tabpage(curtab_save)))
{
+ if (curtab != curtab_save && valid_tabpage(curtab_save))
+ goto_tabpage_tp(curtab_save, FALSE, FALSE);
+
/* When the first completion is done and the preview
* window is not resized, skip the preview window's
* status line redrawing. */