diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-08-22 14:14:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-08-22 14:14:27 +0200 |
commit | 74cd624fdeef12526e1f69b9ddaee037fcef8f3f (patch) | |
tree | 5a9a97270c6770e76929510bbcb92f0399f9d71f /src/main.c | |
parent | 67652c2935ce5a4313bb071f06b9fa476e10ef78 (diff) | |
download | vim-git-74cd624fdeef12526e1f69b9ddaee037fcef8f3f.tar.gz |
updated for version 7.4.007v7.4.007
Problem: Creating a preview window on startup leaves the screen layout in a
messed up state. (Marius Gedminas)
Solution: Don't change firstwin. (Christian Brabandt)
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c index 884a3082b..7d01a232b 100644 --- a/src/main.c +++ b/src/main.c @@ -2727,6 +2727,7 @@ edit_buffers(parmp) int arg_idx; /* index in argument list */ int i; int advance = TRUE; + win_T *win; # ifdef FEAT_AUTOCMD /* @@ -2816,24 +2817,22 @@ edit_buffers(parmp) # ifdef FEAT_AUTOCMD --autocmd_no_enter; # endif + + /* make the first window the current window */ + win = firstwin; #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) - /* - * Avoid making a preview window the current window. - */ - if (firstwin->w_p_pvw) + /* Avoid making a preview window the current window. */ + while (win->w_p_pvw) { - win_T *win; - - for (win = firstwin; win != NULL; win = win->w_next) - if (!win->w_p_pvw) - { - firstwin = win; - break; - } + win = win->w_next; + if (win == NULL) + { + win = firstwin; + break; + } } #endif - /* make the first window the current window */ - win_enter(firstwin, FALSE); + win_enter(win, FALSE); # ifdef FEAT_AUTOCMD --autocmd_no_leave; |