diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-12-24 00:22:39 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-12-24 00:22:39 +0100 |
commit | a42df5934bdc1178ed2ee8cb9c8686975b578497 (patch) | |
tree | 64732c9f937ec217720ab991f89248a1b112abe8 /src/fileio.c | |
parent | 5d24a2257e597fd752e33b2c1e9c19cf9114a517 (diff) | |
download | vim-git-a42df5934bdc1178ed2ee8cb9c8686975b578497.tar.gz |
patch 8.1.0630: "wincmd p" does not work after using an autocmd windowv8.1.0630
Problem: "wincmd p" does not work after using an autocmd window.
Solution: Store "prevwin" in aco_save_T. (Christian Brabandt, closes #3690)
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index bf46522b9..fd8fd243f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -9017,6 +9017,7 @@ aucmd_prepbuf( aco->save_curwin = curwin; aco->save_curbuf = curbuf; + aco->save_prevwin = prevwin; if (win != NULL) { /* There is a window for "buf" in the current tab page, make it the @@ -9127,6 +9128,8 @@ win_found: else /* Hmm, original window disappeared. Just use the first one. */ curwin = firstwin; + if (win_valid(aco->save_prevwin)) + prevwin = aco->save_prevwin; #ifdef FEAT_EVAL vars_clear(&aucmd_win->w_vars->dv_hashtab); /* free all w: variables */ hash_init(&aucmd_win->w_vars->dv_hashtab); /* re-use the hashtab */ @@ -9177,6 +9180,8 @@ win_found: curwin = aco->save_curwin; curbuf = curwin->w_buffer; + if (win_valid(aco->save_prevwin)) + prevwin = aco->save_prevwin; /* In case the autocommand move the cursor to a position that that * not exist in curbuf. */ check_cursor(); |