diff options
author | Bram Moolenaar <bram@vim.org> | 2013-06-15 21:54:16 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2013-06-15 21:54:16 +0200 |
commit | 92a759ba2f674ce4572d83fc6befc57a43e0598b (patch) | |
tree | 4ed2b3bd0fdb826fed44cfb76352632d998e1d45 | |
parent | e8ce0b24a0a05727b32d5b9dbfd6b36f3f014641 (diff) | |
download | vim-92a759ba2f674ce4572d83fc6befc57a43e0598b.tar.gz |
Problem: When a startup script creates a preview window, it probably
becomes the current window.
Solution: Make another window the current one. (Christian Brabandt)
-rw-r--r-- | src/main.c | 20 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 21 insertions, 1 deletions
@@ -2816,7 +2816,25 @@ edit_buffers(parmp) # ifdef FEAT_AUTOCMD --autocmd_no_enter; # endif - win_enter(firstwin, FALSE); /* back to first window */ +#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) + /* + * Avoid making a preview window the current window. + */ + if (firstwin->w_p_pvw) + { + win_T *win; + + for (win = firstwin; win != NULL; win = win->w_next) + if (!win->w_p_pvw) + { + firstwin = win; + break; + } + } +#endif + /* make the first window the current window */ + win_enter(firstwin, FALSE); + # ifdef FEAT_AUTOCMD --autocmd_no_leave; # endif diff --git a/src/version.c b/src/version.c index bb9edce1..2f47dad7 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1201, +/**/ 1200, /**/ 1199, |