diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-02-11 14:09:45 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-02-11 19:03:27 +0100 |
commit | d285d6ca0dc5123b5111239140751f4d986ee15c (patch) | |
tree | dc3328cd439b76ecb4fc9ed791935c152f723b61 /src/nvim/popupmnu.c | |
parent | abed6a0b1a71e54b143e98678f4daa6818b02f8d (diff) | |
download | rneovim-d285d6ca0dc5123b5111239140751f4d986ee15c.tar.gz rneovim-d285d6ca0dc5123b5111239140751f4d986ee15c.tar.bz2 rneovim-d285d6ca0dc5123b5111239140751f4d986ee15c.zip |
vim-patch:8.0.1223: crash when using autocomplete and tab pages
Problem: Crash when using autocomplete and tab pages.
Solution: Check if the current tab changed. (Christian Brabandt, closes
vim/vim#2239)
https://github.com/vim/vim/commit/9ad89c6c4f89cd710d8244d8010b8b0ae30ba79d
Diffstat (limited to 'src/nvim/popupmnu.c')
-rw-r--r-- | src/nvim/popupmnu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index bf79e4b84f..348daf028a 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -567,6 +567,7 @@ static int pum_set_selected(int n, int repeat) && (repeat <= 1) && (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 @@ -647,7 +648,12 @@ static int 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. |